I am getting a "compile error object required" at set lastrow. Not sure how to fix it so any help will be really appreciated. Thanks.
Sub copydata()
Dim lastrow As Long
Dim CrossTBrow
Dim i As Long
Set lastrow = Worksheets("Trial Balance").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lastrow
Worksheets("Trial Balance").Cells(i, 1).Copy
CrossTBrow = Worksheets("Cross Tabular Raw Data").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Worksheets("Trial Balance").Paste Destination:=Worksheets("Cross Tabular Raw Data").Cells(CrossTBrow, 1)
Next i
Sub copydata()
Dim lastrow As Long
Dim CrossTBrow
Dim i As Long
Set lastrow = Worksheets("Trial Balance").Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To lastrow
Worksheets("Trial Balance").Cells(i, 1).Copy
CrossTBrow = Worksheets("Cross Tabular Raw Data").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Worksheets("Trial Balance").Paste Destination:=Worksheets("Cross Tabular Raw Data").Cells(CrossTBrow, 1)
Next i