ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ActiveCell.Address (https://www.excelbanter.com/excel-programming/305142-activecell-address.html)

Todd huttenstine

ActiveCell.Address
 
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

Bob Phillips[_7_]

ActiveCell.Address
 
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)

--
HTH

-------

Bob Phillips
"Todd Huttenstine" wrote in message
...
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




Nigel

ActiveCell.Address
 
Use......

Location = ActiveCell.Row

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

Cheers
Nigel

"Todd Huttenstine" wrote in message
...
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




Bob Umlas[_5_]

ActiveCell.Address
 
Location = Activecell.Row

-----Original Message-----
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
.



All times are GMT +1. The time now is 03:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com