Identifying Beginning and Ending Rows in a Selected Range

J

JR_06062005

Is there a way in VB to identify the beginning and ending rows in a selected
range. The command below gives the address:

ActiveWindow.RangeSelection.Address

But what I want to do is to determine how many rows (and perhaps columns)
are in a selected range.
 
M

Mike H

Maybe

Sub Macro2()

x = Selection.Rows.Count
y = Selection.Columns.Count
MsgBox x & " Rows. " & y & " Columns."

End Sub

Mike
 
J

JR_06062005

Thanks. That did the trick.

Mike H said:
Maybe

Sub Macro2()

x = Selection.Rows.Count
y = Selection.Columns.Count
MsgBox x & " Rows. " & y & " Columns."

End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top