Smithsat34
Board Regular
- Joined
- Jan 20, 2014
- Messages
- 54
Hi Board,
Am a little out of practise with VBA. I'm getting a 438 error on the macro below.
I'm trying to copy the content of column A, in blocks of 5 rows and transpose into 5 columns on sheet 3.
Sub Macro4()
Dim x As Integer
Dim y As Integer
Dim z As Integer
Dim lastRow As Long
x = 1
y = 5
z = 1
lastRow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row
For A = 1 To lastRow
Worksheets("Sheet2").Range("A" & x & ":A" & y).Copy
Worksheets("Sheet3").Range("A" & z).Selection.PasteSpecial Transpose:=True
x = x + 5
y = y + 5
z = z + 1
Next A
End Sub
The error message appears at the paste line.
Thanks in advance
bob
Am a little out of practise with VBA. I'm getting a 438 error on the macro below.
I'm trying to copy the content of column A, in blocks of 5 rows and transpose into 5 columns on sheet 3.
Sub Macro4()
Dim x As Integer
Dim y As Integer
Dim z As Integer
Dim lastRow As Long
x = 1
y = 5
z = 1
lastRow = Sheet2.Cells(Rows.Count, "A").End(xlUp).Row
For A = 1 To lastRow
Worksheets("Sheet2").Range("A" & x & ":A" & y).Copy
Worksheets("Sheet3").Range("A" & z).Selection.PasteSpecial Transpose:=True
x = x + 5
y = y + 5
z = z + 1
Next A
End Sub
The error message appears at the paste line.
Thanks in advance
bob