Hi there, this is the code I've written:
Now If I count the number of rows with "aantalrij" the result is 512 what is ok. And now I expected the macro to repeat 512 times the same procedure, but it only do 2 lines and than it leaves the procedure. What am I overlooking here?
Thanks
Code:
Sub mu_aan_cost_zero()
Dim mijnbereik As Range
Dim aantalrij, volgenderij As Integer
Worksheets(1).Activate
'copy first row
Cells(1, 1).Copy
Range(Cells(2, 1), Cells(12, 1)).Select
Selection.Insert Shift:=xlDown
Set mijnbereik = Sheets(1).Range("A1").CurrentRegion
aantalrij = mijnbereik.Rows.Count
'copy next rows
For aantalrij = 1 To aantalrij 'moet hier komen
volgenderij = (aantalrij * 12) + 1
Cells(volgenderij, 1).Copy
Range(Cells(volgenderij + 1, 1), Cells(volgenderij + 11, 1)).Select
Selection.Insert Shift:=xlDown
Next aantalrij
End Sub
Now If I count the number of rows with "aantalrij" the result is 512 what is ok. And now I expected the macro to repeat 512 times the same procedure, but it only do 2 lines and than it leaves the procedure. What am I overlooking here?
Thanks