I have code below that I need to modify.
The line that reads "For Col = 3 To 33" needs to be modified to extend only as far as there is data in the individual row. So in english it would read: "For Col = 3 To "last cell in this row containing data".
I know this is fairly simple but I can't find anything on the board that tells me how this is done.
Thanks for the help.
Code:
Sub GroupTranspose()
Dim FromRowA As Long
Dim ToRow As Long
Dim Col As Integer
'----------------------------------
LastLine = Worksheets("Sheet1").UsedRange.Rows.Count
ToRow = 1
For FromRowA = 2 To LastLine
For Col = 3 To 33
Y = Worksheets("Sheet1").Cells(FromRowA, Col).Value
Worksheets("Sheet2").Cells(ToRow + 1, 2).Value = Y
ToRow = ToRow + 1
Next Col
Next FromRowA
End Sub
The line that reads "For Col = 3 To 33" needs to be modified to extend only as far as there is data in the individual row. So in english it would read: "For Col = 3 To "last cell in this row containing data".
I know this is fairly simple but I can't find anything on the board that tells me how this is done.
Thanks for the help.