Looping through ranges
Hi ALL,
Ive got this simplified macro which copies data from Range C7:G2000
and pastes it in n other ranges in the same worksheet:
Dim n As Integer, i As Integer
n = Range("L4")
For i = 1 To n
Range("B4") = Cells(7 + i, 11)
€˜do something
Cells(6, 5 * i + 7) = Cells(7 + i, 11)
Range("C7:G2000").Select
Selection.Copy
Cells(7, 5 * i + 7).Select
ActiveSheet.Paste
Cells(6, 5 * i + 7).Select
€˜do something
Next i
Now Im trying to create a macro which does the opposite: Copy Data from
range L7:P2000 ïƒ*Paste the copied data in C8ïƒ*do somethingïƒ*Copy Data from
C7:G2001 and Paste it back in L7. Then Copy Data from the next 5 columns
range Q7:U2000 ïƒ*Paste the copied data in C8ïƒ*do somethingïƒ*Copy Data from
C7:G2000 and Paste back in Q7 and so on n times. As you can see from the
above code n = Range("L4").
Any help is highly appreciated as always.
Tim
|