ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How can I get a cursor location to use in a formula (e.g. IF A1,"Y (https://www.excelbanter.com/excel-worksheet-functions/239671-how-can-i-get-cursor-location-use-formula-e-g-if-a1-y.html)

RFP330

How can I get a cursor location to use in a formula (e.g. IF A1,"Y
 
I want to be able to display text in a cell based on where the cursor is
located.

An example would be if cell a1 is selected by placing the cursor in A1, a
text box below would display a message. Can't seem to find any help text on
this.

Bernie Deitrick

How can I get a cursor location to use in a formula (e.g. IF A1,"Y
 
You would need to use the Selection change event of the worksheet: copy this code, right-click the
sheet tab, select "View Code" and paste the code into the window that appears.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox "The Activecell is " & ActiveCell.Address(False, False)
End Sub

HTH,
Bernie
MS Excel MVP


"rfp330" wrote in message
...
I want to be able to display text in a cell based on where the cursor is
located.

An example would be if cell a1 is selected by placing the cursor in A1, a
text box below would display a message. Can't seem to find any help text on
this.





All times are GMT +1. The time now is 05:12 AM.

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