ActiveCell.Address

T

Todd Huttenstine

Hey guys

The below code pulls back the active cell address. How do
I get it to return only the number portion of the
address? For instance if location is equal to J22, I want
to retrieve only the 22.

Dim Location
Location = ActiveCell.Address



Thank you
Todd Huttenstine
 
B

Bob Phillips

Dim Location
Dim i As Long
Location = ActiveCell.Address(True, False)
For i = 2 To 3
If Mid(Location, i, 1) = "$" Then
Exit For
End If
Next
Location = Mid(Location, i + 1, 3)
 
N

Nigel

Use......

Location = ActiveCell.Row

You can also use: ActiveCell.Column to get the column number if you need
that.

Cheers
Nigel
 
Top