How can I get a cursor location to use in a formula (e.g. IF A1,"Y

R

rfp330

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.
 
B

Bernie Deitrick

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
 
J

Jayson

If you want text to appear when you hover the mouse above a cell, then add a
comment.

If you want text to appear when the cell is selected you can use data
validation.

Neither of these options requires any code.
 

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

Top