I have a user form where the user will enter in how many labels they want printed. This value shows up on the spreadsheet in column Q2:Q640. Depending on what the value is I want it to copy the data in column C2:C640 to the next cell below. For instance if there is a quantity in Q2 of 5 and the data in C2 is 123456 I want C2 to be copied and pasted 4 more times into C3,C4,C5,C6 and this to happen on each row after that based on the value in Column Q. The code I have been trying isn't copying or pasting for me. Any help or guidance in the right direction would help me out a great deal
Code:
Private Sub LabelQTY_Change()
Dim y As Long
If TargetAddress = "$Q$2" Then
If IsNumeric(Target) And Not IsEmpty(Target) Then
Application.EnableEvents = False
y = Range("Q2:Q640").Value
Range("C2:C640").AutoFill Destination:=Range("C2:C" & 2 + i), _
Type:=xlFillDefault
Application.EnableEvents = True
End If
On Error Resume Next
End If
End Sub