I have a matrix file with 83 comlumns and 21,000+ employees
In column A returns the employee ID#
Column B returns Column headers
Column C Returns the Value in the field
field values of : Complete; "NR"; or NULL.
---------------------------------------------------------------------------
[TABLE="width: 1033"]
<TBODY>[TR]
[TD]Employee Id</SPAN>
[/TD]
[TD]Item 1</SPAN>
[/TD]
[TD]Item 2</SPAN>
[/TD]
[TD]Item 3</SPAN>
[/TD]
[TD]Item 4</SPAN>
[/TD]
[TD]Item 5</SPAN>
[/TD]
[TD]Item 6</SPAN>
[/TD]
[TD]Item 7</SPAN>
[/TD]
[TD]Item 8</SPAN>
[/TD]
[TD]Item 9</SPAN>
[/TD]
[TD]Item 10</SPAN>
[/TD]
[TD]Item 11</SPAN>
[/TD]
[TD]Item 12</SPAN>
[/TD]
[/TR]
[TR]
[TD]1555</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1563</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1652</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1688</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1708</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1734</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1809</SPAN>
[/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
----------------------------------------------------------------------------
RESULTS from VB code below
[TABLE="width: 126"]
<TBODY>[TR]
[TD="class: xl66, width: 56, bgcolor: transparent"]Row
[/TD]
[TD="class: xl66, width: 56, bgcolor: transparent"]Column
[/TD]
[TD="class: xl66, width: 56, bgcolor: transparent"]Value
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 1
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 2
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 3
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 4
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 5
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 6
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 7
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 8
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 9
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 10
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 11
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 12
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 1
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 2
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 3
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 4
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 5
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 6
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 7
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 8
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 9
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 10
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 11
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 12
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1652
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 1
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
</TBODY>[/TABLE]
----------------------------------------------------------------------------
VB Script I found on the web
Problem is: The script exceeds excels 1 million rows -
How can the VB Code be adjusted to exlude the "NR" values on the new worksheet?
In column A returns the employee ID#
Column B returns Column headers
Column C Returns the Value in the field
field values of : Complete; "NR"; or NULL.
---------------------------------------------------------------------------
[TABLE="width: 1033"]
<TBODY>[TR]
[TD]Employee Id</SPAN>
[/TD]
[TD]Item 1</SPAN>
[/TD]
[TD]Item 2</SPAN>
[/TD]
[TD]Item 3</SPAN>
[/TD]
[TD]Item 4</SPAN>
[/TD]
[TD]Item 5</SPAN>
[/TD]
[TD]Item 6</SPAN>
[/TD]
[TD]Item 7</SPAN>
[/TD]
[TD]Item 8</SPAN>
[/TD]
[TD]Item 9</SPAN>
[/TD]
[TD]Item 10</SPAN>
[/TD]
[TD]Item 11</SPAN>
[/TD]
[TD]Item 12</SPAN>
[/TD]
[/TR]
[TR]
[TD]1555</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1563</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1652</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1688</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1708</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1734</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
[TR]
[TD]1809</SPAN>
[/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD]Complete</SPAN>
[/TD]
[TD][/TD]
[TD]NR</SPAN>
[/TD]
[TD]NR</SPAN>
[/TD]
[/TR]
</TBODY>[/TABLE]
----------------------------------------------------------------------------
RESULTS from VB code below
[TABLE="width: 126"]
<TBODY>[TR]
[TD="class: xl66, width: 56, bgcolor: transparent"]Row
[/TD]
[TD="class: xl66, width: 56, bgcolor: transparent"]Column
[/TD]
[TD="class: xl66, width: 56, bgcolor: transparent"]Value
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 1
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 2
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 3
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 4
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 5
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 6
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 7
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 8
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 9
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 10
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 11
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1555
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 12
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 1
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 2
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 3
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 4
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 5
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 6
[/TD]
[TD="class: xl66, bgcolor: transparent"]Complete
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 7
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 8
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 9
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 10
[/TD]
[TD="class: xl66, bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 11
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1563
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 12
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
[TR]
[TD="class: xl66, bgcolor: transparent"]1652
[/TD]
[TD="class: xl66, bgcolor: transparent"]Item 1
[/TD]
[TD="class: xl66, bgcolor: transparent"]NR
[/TD]
[/TR]
</TBODY>[/TABLE]
----------------------------------------------------------------------------
VB Script I found on the web
Code:
Sub NormaliseTable()
' start with the cursor in the table
Dim rTab As Range, C As Range, rNext As Range
Set rTab = ActiveCell.CurrentRegion
If rTab.Rows.Count=1 Or rTab.Columns.Count = 1 Then
MsgBox "Not a well-formed table!"
Exit Sub
End If
Worksheets.Add ' the sheet for the results
Range("A1:C1") = Array("Row","Column","Value")
Set rNext = Range("A2")
For Each C In rTab.Offset(1,1).Resize(rTab.Rows.Count-1, _
rTab.Columns.Count-1).Cells
If Not IsEmpty(C.Value) Then
rNext.Value = rTab.Cells(C.Row-rTab.Row+1,1)
rNext.Offset(0,1).Value = rTab.Cells(1,C.Column-rTab.Column+1)
rNext.Offset(0,2).Value = C.Value
Set rNext = rNext.Offset(1,0)
End If
Next
End Sub
Problem is: The script exceeds excels 1 million rows -
How can the VB Code be adjusted to exlude the "NR" values on the new worksheet?