Hi, I am just learning VBA code, trying to write code to copy cells in column A for a specified number of times (Specified in Range C2) until the next cell is blank.
The below code is coping range A10 three times but it copies range A14 four times. What is an error?
Sub Copy_rows1()
'
'
'
Dim j As Integer
j = Range("C2")
Range("A10").Select
ActiveCell.Copy
Do Until ActiveCell.Value < 1
For j = 1 To j
ActiveCell.Offset(1, 0).PasteSpecial xlPasteValues
'x = Range("A10")
' Range("A10").Select
' Selection.Copy
' ActiveCell.Offset(1, 0).PasteSpecial Paste:=xlPasteValues
Next j
ActiveCell.Offset(1, 0).Select
ActiveCell.Copy
Loop
End Sub