#1   Report Post  
Posted to microsoft.public.excel.misc
PW11111
 
Posts: n/a
Default If Cursor = ??

Hi,

I need a some help with the following.

I have 3 cells A1, A2, A3.
I have a detail cell B5
I need to display a differing message in B5 - depending on if the cursor is
hovering over either A1, A2, A3.
I think I need the code that says - if cursor = A1 then display "Hello A1".
or if cursor = A2 then display "Hello A2".

I hope this makes sense - any help would be great.

Phil
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default If Cursor = ??

If you want to display that message when the cursor is hovering over the cell,
maybe you can use the comment for that cell.

You could use the worksheet_selectionchange event if you wanted to see the
message when that cell was selected.

Rightclick on the worksheet tab and select view code. Paste this into the code
window that just opened.

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Me.Range("B5").Value = ""

If Target.Cells.Count 1 Then Exit Sub

If Intersect(Target, Me.Range("a1:A3")) Is Nothing Then
Exit Sub
End If

Me.Range("B5").Value = "Hello " & Target.Address(0, 0)

End Sub


Then back to excel and select one of those cells.

PW11111 wrote:

Hi,

I need a some help with the following.

I have 3 cells A1, A2, A3.
I have a detail cell B5
I need to display a differing message in B5 - depending on if the cursor is
hovering over either A1, A2, A3.
I think I need the code that says - if cursor = A1 then display "Hello A1".
or if cursor = A2 then display "Hello A2".

I hope this makes sense - any help would be great.

Phil


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"