Custom Help Message for a Cell


Posted by Rebecca on February 07, 2002 8:59 AM

I have a spread sheet that whenever I click in a specific cell, the Office Assistant shows a custom message for that cell (ie: when I click on cell A3, the Office Assitant displays "Enter your name")

How did they do this? I want to do it in a spreadsheet I'm working on.

Thanks,

Rebecca

Posted by DK on February 07, 2002 9:37 AM


They probably did it using something like this:-

Right click on any worksheet tab and choose View Code. Paste this:-

Option Explicit

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim CellMsg As String

Select Case LCase(Target.Address)
Case "$a$1"
CellMsg = "Eat your greens"
Case "$a$2"
CellMsg = "An apple a day keeps the doctor away"
Case "$a$3"
CellMsg = "Don't spend too much time with Excel, there's beer to be drunk"
Case Else
End Select


If CellMsg <> "" Then
With Assistant.NewBalloon
.Heading = "Info for cell " & Target.Address
.Text = CellMsg
.Button = msoButtonSetOK
.Show
End With
End If

End Sub


Is that what you're after?

Laters,
Dan

Posted by Juan Pablo G. on February 07, 2002 1:27 PM

Actually, it's MUCH easier using Data Validation. Select A3, go to Data Validation, select the second page (Input Message), you should see the "Title" and "Message" there. If the Assistant is ON it will show the message, if not, a small window will appear next to the cell.

Juan Pablo G.



Posted by Rebecca on February 08, 2002 6:43 AM

Dan & Juan,

They both work beautifully! Thanks!

Rebecca