I have 2 range variables. I want to have a loop that takes the first row of one range variable and add it to the end of the other range variable.
ie:
rng1 = Range("1:10")
rng2 = Range("11:20")
I want to take row 11 from rng2 and give it to rng1 so that the result is:
rng1 = Range("1:11")
rng2 = Range("12:20")
and each time the loop runs it will take from the top of rng2 and give to the end of rng1.
I was trying to do this with Union or Resize but its not working the way I need it to. In Java I know this can be done through the use of Arrays but im not sure how that would be layed out in VBA.
Set rng1 = rng1.Resize(rng1.Rows.Count + 1, rng1.Columns.Count)
Set rng2 = rng2.Resize(rng2.Rows.Count - 1, rng2.Columns.Count)
any suggestions would be greatly appriciated.
Set rng2 = rng2.offset(1,0).Resize(rng2.Rows.Count - 1, rng2.Columns.Count)
– Tim Williams