Get the row and column of a range address

TomPC

Board Regular
Joined
Oct 13, 2011
Messages
95
Example range: "A1:D9"

Is there a smarter way of getting the last row (9) and last column (D=4) of a range address than:

Code:
range(mid(selection.address,instr(1,selection.address,":")+1,200)).Row
range(mid(selection.address,instr(1,selection.address,":")+1,200)).Column

I'm hoping for some nice object-based solution like:
Code:
selection.TheLastRowInTheUniverse
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Or

Code:
With Selection
    MsgBox .Offset(.Rows.Count - 1).Row
    MsgBox .Offset(, .Columns.Count - 1).Column
End With
 
Upvote 0

Forum statistics

Threads
1,222,441
Messages
6,166,054
Members
452,010
Latest member
triangle3

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