Copying through last row with data

cheesiepoof05

Board Regular
Joined
Dec 30, 2010
Messages
82
I have this code that I am using within a much larger code. "Rows("11:10000").Select". I'm trying to select row 11 through the last row with data in it. Not all of column A has values so it need to check the entire row. I'm currently going to row 10,000 just to make sure I capture everything, but it creates a lot of extra rows I don't need. I'm looking for code that will select row 11 through my last row with data. Thanks for any help.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Try this instead:

VBA Code:
Rows("11:" & Cells(Rows.Count,"A").End(xlUp).Row).Select
 
Upvote 0
@Joe4 and @MARK858. Thank you both so much for your help. I tested both methods out and ultimately went with "Rows("11:" & Cells.Find("*", , xlValues, , xlByRows, xlPrevious).Row).Select" because it accounts for the possibility of column A being blank for the last few rows, when the other columns still contain data. The other solution would probalby work 99% of the time for me, I just wanted to be absolutely sure I didn't drop data. Again, thank you both!
 
Upvote 0
You are welcome.
Yes, my solution only works if column A is always populated for every row of data. Sorry I missed that part in your original request.
Mark's approach should work better for you.
 
Upvote 0

Forum statistics

Threads
1,215,034
Messages
6,122,782
Members
449,095
Latest member
m_smith_solihull

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