Hi All,
New to VBA, but I have some VBA code to call a sub which copies, tranposes and pastes the row as a column in a different sheet.
It loops through rows 1 to 10.
The bit I'm stuck on is the syntax for .Range("B:Z") to include the X, tried things like .Range("B:Z" & X) or .Range("B" & X : "Z" & X) which don't work.
.Range("A" & X) works fine. Could anyone help with the correct syntax for this?
Thanks for the help in advance!
New to VBA, but I have some VBA code to call a sub which copies, tranposes and pastes the row as a column in a different sheet.
It loops through rows 1 to 10.
The bit I'm stuck on is the syntax for .Range("B:Z") to include the X, tried things like .Range("B:Z" & X) or .Range("B" & X : "Z" & X) which don't work.
.Range("A" & X) works fine. Could anyone help with the correct syntax for this?
VBA Code:
For X = 1 To 10
Call transposeAndPasteRow(Worksheets("Sheet 1").Range("A" & X), Worksheets("Sheet 2").Range("A999999").End(xlUp))
Call transposeAndPasteRow(Worksheets("Sheet 1").Range("B1:Z1"), Worksheets("Sheet 2").Range("C999999").End(xlUp))
Next X
Thanks for the help in advance!