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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try like this

Code:
MsgBox Selection.Row + Selection.Rows.Count - 1
 
Upvote 0
Or

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

Forum statistics

Threads
1,203,242
Messages
6,054,350
Members
444,718
Latest member
r0nster

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