Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to reference variable range in a loop
Dear all,
In my loop the number of rows for range changes. I have to copy paste from one Sheet to other. I tried following ways: .... d = number_rows = ... name_range = "a2:i" & number_rows + 1 Sheets(1).range(name_range).Value = Sheets(2).range(name_range).offset (d,0).Value ..... This does not work... the second way I tried .... d = ... number_rows = ... Sheets(1).range(Cells(2,1), Cells(number_rows+1,9)).Value = Sheets(2).range(Cells(2,1), Cells(number_rows+1+d,9)).Value ..... This does not work too... Please help How to prepare a reference using Concatenate or any other function? How can one use Cells in Range(...) in multiple Sheets? Thanks for your time Samir |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to reference variable range? | Excel Discussion (Misc queries) | |||
For Each ... Next loop - need to reference the loop variable | Excel Programming | |||
Setting a range within a loop variable for copy/paste | Excel Programming | |||
Variable Range Reference | Excel Programming | |||
Excel VBA Loop & Variable Reference | Excel Programming |