Msg Box by selecting cell

Amortcal

New Member
Joined
May 5, 2002
Messages
10
Is it possible to have a Msg Box popped up by just selecting a cell? That is, can Excel be so programmed that as I select cell A1, a Msg Box pops up with a message?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
What is the reason for you wanting the message box to cokme up when they click a cell?

you may find the users in here can give you a better solution if you tell us why you want to do it this difficult way?
 
Upvote 0
Right click on the sheet tab. Click View Code. This will launch the VBA editor with the following:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)

End Sub

add the following code after the first line:

If ActiveCell.Address = "$A$1" Then
MsgBox "Your message here"
End If
 
Upvote 0
Yeah, right click on the name tab of the sheet that you want the messagebox to appear on when "A1" is selected, choose "View Code" and stick in this code:

<pre>
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target = Me.Range("A1") Then
MsgBox "Hi"
End If
End Sub</pre>

As for getting the messagebox to appear right next to the cell, that isn't going to happen. A comment is probably going to be your best bet. (there's another text box thingy, but I can't remember how to insert that)
 
Upvote 0
If you don't want to get into coding you can also get a pop-up input message by using the "Data"..."validation"..."input message" option from the tool bar.
 
Upvote 0
Hey cruzzin, "cruzzinn for a bruzzin"

easy on the freudian slip, cokme?
as i figured!


James
 
Upvote 0

Forum statistics

Threads
1,213,489
Messages
6,113,953
Members
448,535
Latest member
alrossman

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