Looping until the last row in sheet - copy cell i until last colmn

KNKN9

Board Regular
Joined
Mar 27, 2017
Messages
92
Hi and thanks,


Data set

Col A Col B Col C Col D Col E Col F Col G
Row 1 x x x x x x x
Row 2 x x x x x x x
Row 3 x x x x x x x
Row 4 x x x x x x x



<colgroup><col><col><col><col><col><col><col span="2"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>

I need to copy each row separately ( baring in mind my data my not always start in row 1 so the row starting point is unknown. I need to do this until the last row so in this case row 4.

I am only able to do this if I know my starting row I am struggling to get this done when not knowing the starting row.

I have the code below

Code:
For i = 79 To LastRow
    Range(i, Rng).Copy
    Next i
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I don't know what you have in Rng, but the row number i must be in cells(i, x) or in Range(x & i)

Maybe something like this:

Code:
  LastRow = Range("A" & Rows.Count).End(xlUp).Row
  For [B][COLOR=#FF0000]i[/COLOR][/B] = LastRow To 1 Step -1
    If Cells([SIZE=3][B][COLOR=#ff0000]i[/COLOR][/B][/SIZE], Rng).Value = "" Then Exit For
    Range(Rng & [B][COLOR=#FF0000]i[/COLOR][/B]).Copy
  Next i
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,040
Members
449,063
Latest member
ak94

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top