I have this code, where I first insert a row on every 15th row, in effort to break apart my data. I then want to to cut what is in rows 2 to 14, and paste to row 1. Then I want to delete the now empty rows 2 to 14, and I want the process to start over (where it now uses row 2 as the pasting row for what is in rows 3 to 15), etc. etc.
Any ideas on the modifications I can make, sorry new to VBA..
Sub insertro()
Dim r As Long, lr As Long
lr = Range("A" & rows.Count).End(xlUp).Row + 100000
For r = 15 To lr Step 15
rows(r).Insert Shift:=xlDown
Next r
i = 1
n = 2
lastrow = ActiveSheet.Cells(rows.Count, 1).End(xlUp).Row
For n = 2 To lastrow
With ActiveSheet
.Range("A" & n, Range("A" & n).End(xlToRight)).Cut .Range("A" & i).End(xlToRight).Offset(, 1)
End With
Next n
End Sub
Any ideas on the modifications I can make, sorry new to VBA..
Sub insertro()
Dim r As Long, lr As Long
lr = Range("A" & rows.Count).End(xlUp).Row + 100000
For r = 15 To lr Step 15
rows(r).Insert Shift:=xlDown
Next r
i = 1
n = 2
lastrow = ActiveSheet.Cells(rows.Count, 1).End(xlUp).Row
For n = 2 To lastrow
With ActiveSheet
.Range("A" & n, Range("A" & n).End(xlToRight)).Cut .Range("A" & i).End(xlToRight).Offset(, 1)
End With
Next n
End Sub