Hi everyone,
I have two dyanmic lists of codes:
In other words I am trying to create a table that associates all the CARTs to all the CPCOs.
The best I succeeded to "code" is to copy and paste n times (Cell F1 value) all the CPCOs into the table.
Here it is the code:
But how can I then copy and past all the CARTs for each copied CPCO?
Mark
I have two dyanmic lists of codes:
- In Column A a dynamic list of Retail Stores IDs
- In Column C a dynamic list of Article Codes
In other words I am trying to create a table that associates all the CARTs to all the CPCOs.
The best I succeeded to "code" is to copy and paste n times (Cell F1 value) all the CPCOs into the table.
Here it is the code:
VBA Code:
Sub Repeatdata()
Dim cell As Range
Dim lr As Long
Dim n As Long
Dim r As Long
Application.ScreenUpdating = False
lr = Cells(Rows.Count, "A").End(xlUp).Row
n = Range("F1").Value
r = 2
For Each cell In Range("A2:A" & lr)
Range(Cells(r, "I"), Cells(r + n - 1, "I")) = cell.Value
r = r + n
Next cell
Application.ScreenUpdating = True
End Sub
But how can I then copy and past all the CARTs for each copied CPCO?
Mark