Row Selection

D

DCSwearingen

I am looking at how to find the first row in a selection when the use
selects a range of rows.

If a user selects rows 2 through 800, I need to know that row 2 is th
first row in the range.

If I use:

Dim myAddress as string
myaddress = selection.address

I get my Address as "$2:$800"

How is the most efficient way of identifying the first row as row 2
 
G

Guest

The following function returns the active cell address:

Function WhereAmI() As String

Dim strCell As String

strCell = ActiveCell.Address
'Omit the following line if you want an absolute address
strCell = Application.ConvertFormula(strCell, xlA1, xlA1, xlRelative)

WhereAmI = strCell

End Function
 

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