S
Steve
In the code below, I'm getting an error when I get to:
curWks.Cells(iRow, "A") = sh.Cells(1, colvalue).Value
---------------------------------------------------------------
Sub Data_Dump()
Dim curWks, ws As Worksheet
Dim FirstRow, Lastrow, Rowloop, colval As Integer
Application.ScreenUpdating = False
Set curWks = Worksheets("Data")
Set sh = Worksheets("All States")
curWks.Range("A211376").Clear
iRow = 2
sh.Activate
For colval = 5 To 39
FirstRow = 2
Lastrow = 28
For Row_Loop = FirstRow To Lastrow
curWks.Cells(iRow, "A") = sh.Cells(1, colvalue).Value
curWks.Cells(iRow, "B") = sh.Cells(Row_Loop, 4).Value
curWks.Cells(iRow, "C") = sh.Cells(Row_Loop, colval).Value
iRow = iRow + 1
Next 'for
Next 'for
Application.ScreenUpdating = True
End Sub
curWks.Cells(iRow, "A") = sh.Cells(1, colvalue).Value
---------------------------------------------------------------
Sub Data_Dump()
Dim curWks, ws As Worksheet
Dim FirstRow, Lastrow, Rowloop, colval As Integer
Application.ScreenUpdating = False
Set curWks = Worksheets("Data")
Set sh = Worksheets("All States")
curWks.Range("A211376").Clear
iRow = 2
sh.Activate
For colval = 5 To 39
FirstRow = 2
Lastrow = 28
For Row_Loop = FirstRow To Lastrow
curWks.Cells(iRow, "A") = sh.Cells(1, colvalue).Value
curWks.Cells(iRow, "B") = sh.Cells(Row_Loop, 4).Value
curWks.Cells(iRow, "C") = sh.Cells(Row_Loop, colval).Value
iRow = iRow + 1
Next 'for
Next 'for
Application.ScreenUpdating = True
End Sub