I have a set of individual data in Sheet1 Column "A"
I'd like every single value to repeat "y" times (currently y=33) in Sheet2 Column "A" and then repeat the next value 33 times etc.
I wrote code that repeats the values 33 times, but is overwriting in A1:A33.
Sub vba1()
Dim lrow As Integer
Dim i As Integer
Dim y As Integer
lrow = Sheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row
y = 1
For i = 1 To lrow
Sheets("sheet1").Activate
Cells(i, 1).Select
Selection.Copy
For y = 1 To 33
Sheets("sheet2").Activate
Cells(y, 1).PasteSpecial Paste:=xlPasteValues
Next y
Next i
End Sub
I tried a different approach, to increment y. I got a lot of empty rows:
Sub vba2()
Dim lrow As Integer
Dim i As Integer
Dim y As Integer
lrow = Sheets("sheet1").Cells(Rows.Count, 1).End(xlUp).Row
y = 1
For i = 1 To lrow
Sheets("sheet1").Activate
Cells(i, 1).Select
Selection.Copy
For y = y To y + 33
Sheets("sheet2").Activate
Cells(y, 1).PasteSpecial Paste:=xlPasteValues
y = y + 33
Next y
Next i
End Sub