I'm having some trouble with a nested Do While and For loop in VBA.
In essence, I have two tables. I am trying to repeat each row of the first table however many rows there are in the second table. The number of rows in the second table can vary with time, so unfortunately I can't hard code in the number of rows it has.
In its current state, the for loop only repeats correctly the first row of my table onto the sheet "Var Admin", and does not go to do the same with the second row on the first table.
Here's what I have tried so far:
Sheets("Managers").Select
Range("Table6").Select
managers = ActiveSheet.UsedRange.rows.Count
managers = managers - 1
Set myTable = Worksheets("Var").ListObjects("var_no_format")
my = 1
looper = 1
For Each lr In myTable.ListRows
Do While looper <= managers
lr.Range.rows.Copy Sheets("Var Admin").Range("A" & my)
my = my + 1
looper = looper + 1
Loop
Next lr
What can I try next?