Formula that returns address of the active cell.

Derek

Well-known Member
Joined
Feb 16, 2002
Messages
1,595
Hi Guys and Gals

Is there a formula in Excel that returns the active cell address (ie dynamically). Excel updates the activecell address in the Name Box dynamically as you make a selection but I cannot find a standard formula to access it. I know I can achieve this with code using the selection-change event but this action then disallows use of the Undo button - which I specifically want to avoid. Perhaps there is an add-in available??

thanks for any good ideas

Regards

Derek
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
This is helpful: =CELL("address"). I have a similar but different need... Conceptually I'm looking for excel to take action based on which cell a user selects, and I have a preference for formulas over VBA. Using name manager I named "Active" to refer to =CELL("address"). Then I referenced "=Active" in the cell that will trigger the action. F9 will update this cell with a reference to the active cell.
 
Upvote 0
Howdy to all,

I'm probably missing something, but never minded a friendly jab so will ask. If the formula is better for undo, and only calculation seems problematic, would a forced calc be disadvantageous?

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    [A1].Calculate
End Sub

Thanks,

Mark
Thank you so much Mark, this worked perfectly for my application! I put =CELL("address") in cell A1, and then wrote your code into the VBA, and now I can Undo!
 
Upvote 0

Forum statistics

Threads
1,222,608
Messages
6,167,042
Members
452,093
Latest member
JamesFromAustin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top