convert matrix worrk sheet to a flat file

lefty38

Board Regular
Joined
Oct 27, 2005
Messages
85
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.
---------------------------------------------------------------------------
Employee Id</SPAN>
Item 1</SPAN>
Item 2</SPAN>
Item 3</SPAN>
Item 4</SPAN>
Item 5</SPAN>
Item 6</SPAN>
Item 7</SPAN>
Item 8</SPAN>
Item 9</SPAN>
Item 10</SPAN>
Item 11</SPAN>
Item 12</SPAN>
1555</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
Complete</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
1563</SPAN>
NR</SPAN>
NR</SPAN>
Complete</SPAN>
NR</SPAN>
Complete</SPAN>
Complete</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
1652</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
1688</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
Complete</SPAN>
Complete</SPAN>
NR</SPAN>
NR</SPAN>
Complete</SPAN>
Complete</SPAN>
1708</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
1734</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
NR</SPAN>
1809</SPAN>
NR</SPAN>
NR</SPAN>
Complete</SPAN>
Complete</SPAN>
NR</SPAN>
Complete</SPAN>
Complete</SPAN>
Complete</SPAN>
NR</SPAN>
NR</SPAN>

<TBODY>
</TBODY>

----------------------------------------------------------------------------
RESULTS from VB code below
Row
Column
Value
1555
Item 1
NR
1555
Item 2
NR
1555
Item 3
NR
1555
Item 4
NR
1555
Item 5
NR
1555
Item 6
NR
1555
Item 7
Complete
1555
Item 8
NR
1555
Item 9
NR
1555
Item 10
NR
1555
Item 11
NR
1555
Item 12
NR
1563
Item 1
NR
1563
Item 2
NR
1563
Item 3
Complete
1563
Item 4
NR
1563
Item 5
Complete
1563
Item 6
Complete
1563
Item 7
NR
1563
Item 8
NR
1563
Item 9
NR
1563
Item 10
1563
Item 11
NR
1563
Item 12
NR
1652
Item 1
NR

<TBODY>
</TBODY>
----------------------------------------------------------------------------
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?
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
will the original data always have the APRV status before the UNAP status
will the eg D4567 always be in a block or could they be mixed in with the V6574
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,265
Members
449,219
Latest member
daynle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top