Could you please help me fix this? I'm trying to use this code to cut and paste chunks of info (67 rows long) from column A of my sheet and setting it to start in F6. It's off a bit somehow, as it is not reliably cutting the info at the 67th row. I need it to cut 67 rows, then the next 67 rows, setting these just to the right of the first section that was cut (G6), and repeating this pattern.
It may be a problem caused by my data starting on Row 6 rather than Row 1. Can you please help? Thank you!
This is the code:
Option Explicit
Sub PasteMeans()
Dim lngEndRow As Long
Dim lngMyRow As Long
Dim intStep As Integer
Dim lngColOutput As Long
Application.ScreenUpdating = False
lngEndRow = Cells(Rows.Count, "A").End(xlUp).Row 'Find the last used row in column C.
intStep = 68 'Block of data to be copied
lngColOutput = 6 'Initial output column i.e. column D
For lngMyRow = 69 To lngEndRow Step intStep
Range("A" & lngMyRow & ":A" & lngMyRow + intStep - 1).Cut Destination:=Cells(6, lngColOutput)
lngColOutput = lngColOutput + 1
Next lngMyRow
Application.ScreenUpdating = True
MsgBox "Done", vbInformation
End Sub
Sub PasteMeans2()
Dim lngEndRow As Long
Dim lngMyRow As Long
Dim intStep As Integer
Dim lngColOutput As Long
Application.ScreenUpdating = False
lngEndRow = Cells(Rows.Count, "B").End(xlUp).Row 'Find the last used row in column C.
intStep = 68 'Block of data to be copied
lngColOutput = 6 'Initial output column i.e. column D
For lngMyRow = 69 To lngEndRow Step intStep
Range("B" & lngMyRow & ":B" & lngMyRow + intStep - 1).Cut Destination:=Cells(84, lngColOutput)
lngColOutput = lngColOutput + 1
Next lngMyRow
Application.ScreenUpdating = True
MsgBox "Done", vbInformation
End Sub
It may be a problem caused by my data starting on Row 6 rather than Row 1. Can you please help? Thank you!
This is the code:
Option Explicit
Sub PasteMeans()
Dim lngEndRow As Long
Dim lngMyRow As Long
Dim intStep As Integer
Dim lngColOutput As Long
Application.ScreenUpdating = False
lngEndRow = Cells(Rows.Count, "A").End(xlUp).Row 'Find the last used row in column C.
intStep = 68 'Block of data to be copied
lngColOutput = 6 'Initial output column i.e. column D
For lngMyRow = 69 To lngEndRow Step intStep
Range("A" & lngMyRow & ":A" & lngMyRow + intStep - 1).Cut Destination:=Cells(6, lngColOutput)
lngColOutput = lngColOutput + 1
Next lngMyRow
Application.ScreenUpdating = True
MsgBox "Done", vbInformation
End Sub
Sub PasteMeans2()
Dim lngEndRow As Long
Dim lngMyRow As Long
Dim intStep As Integer
Dim lngColOutput As Long
Application.ScreenUpdating = False
lngEndRow = Cells(Rows.Count, "B").End(xlUp).Row 'Find the last used row in column C.
intStep = 68 'Block of data to be copied
lngColOutput = 6 'Initial output column i.e. column D
For lngMyRow = 69 To lngEndRow Step intStep
Range("B" & lngMyRow & ":B" & lngMyRow + intStep - 1).Cut Destination:=Cells(84, lngColOutput)
lngColOutput = lngColOutput + 1
Next lngMyRow
Application.ScreenUpdating = True
MsgBox "Done", vbInformation
End Sub