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
 

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

Similar Threads

AppleScript - How do I select a text ? 1
.Find and return range 5
Conditional Formatting in 2007 1
Loop is slow trying array code 17
MuliColumn Combo 3
Offset 4
Function 7
compile error in hidden module: sheet1 4

Top