I change the macro and now it looks like underneath:
If I click the button ADD PRODUCT it add products one time.
But I want to relate the functioning of the macro to the button.
Everytime when I click the button it will copy and paste range offset(0,5)
and add Z2,Z3,Z4... name in cell Q1(Z1), V1(Z2) etc.
Here is the code:
Expand|Select|Wrap|Line Numbers
-
Sub CopyPaste()
-
'
-
' CopyPaste Macro
-
'
-
Dim i As Long
-
For i = 1 To 492
-
'Copies the specified selection to the Clipboard
-
Range("I:L").Select
-
Selection.Copy
-
'Paste the specified selection to the specified range
-
Range("I1").Offset(0, 5 * i).Select
-
ActiveSheet.Paste
-
'Unhidde the hidden columns
-
Selection.EntireColumn.Hidden = False
-
Next i
-
'Cancels Cut or Copy mode and removes the moving border
-
Application.CutCopyMode = False
-
End Sub
-
How to change the code to use by CommandButton.
Everytime when I click the button Add copied range to offset(0,5)
to max 492 times.
Now when I click the button Excel copy and paste range one time (492 times)