LukiiMaxim96
New Member
- Joined
- May 18, 2021
- Messages
- 9
- Office Version
- 365
- Platform
- Windows
Hi! I need to loop through a dynamic data set, only the range in which the data are entered is given.
I need to loop through every cell and copy the value to the end of another column. I totally managed that for the first column but now I am stuck with telling excel to increment the row and run the loop again until a certain number is reached. I tried to accomplish that with a nested for next loop but that doesnt work... Any help?
I basically need to insert a variable that increments by one after the initial loop is fullfiled in the 3rd line: Offset(-2 -b,0)
Here is what ive got so far:
Help is highly appreciated!
I need to loop through every cell and copy the value to the end of another column. I totally managed that for the first column but now I am stuck with telling excel to increment the row and run the loop again until a certain number is reached. I tried to accomplish that with a nested for next loop but that doesnt work... Any help?
I basically need to insert a variable that increments by one after the initial loop is fullfiled in the 3rd line: Offset(-2 -b,0)
Here is what ive got so far:
VBA Code:
For a = 0 To CountaColumnsResult - 1
lRow5B = Sheet5.Range("B" & Rows.Count).End(xlUp).Row
Sheet4.Range("K10").End(xlToRight).Offset(-2, a).Copy
Sheet5.Range("B" & lRow5B + 1).PasteSpecial xlPasteValues
Next
Help is highly appreciated!