Select the Last Row in Named Range

MarshalG

New Member
Joined
Mar 26, 2010
Messages
2
Hi all,

I would like to add a line to my macro that selects the last row in a named range ("Report").

I've tried looking for this throughout this forum and I can't seem to find an answer to this problem.

Thanks a lot!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi, Try this:-
Code:
[COLOR="Navy"]Sub[/COLOR] MG26Mar24
[COLOR="Navy"]With[/COLOR] Range("MyRng")
 .Range("A" & .Rows.count).EntireRow.Select
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0
For multi-row range name:
Rows(Split(ThisWorkbook.Names("Report").RefersToRange.Address, "$")(4)).Select

For single-row range name:
Rows(Split(ThisWorkbook.Names("Report").RefersToRange.Address, "$")(2)).Select
 
Upvote 0
Welcome to the Board!

Another way:
Code:
Rows(Range("Report").Rows.Count + Range("Report").Cells(1, 1).Row - 1).EntireRow.Select
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,928
Members
452,366
Latest member
TePunaBloke

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