ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message Box (https://www.excelbanter.com/excel-programming/332802-message-box.html)

jdawg

Message Box
 
I just have a quick question. I have a tab called MASTER and I want to
have a message box pop up whenever someone clicks on this MASTER tab
warning them "Changing these two dates, changes all dates in the
headers of the Excel Worksheet." I believe there is a message box that
shows a circle with an X in it and I think you use +vbCritical, but I'm
not positive. Any help would be greatly appreciated.


Tom Ogilvy

Message Box
 
Look in Excel VBA help at the msgbox command. It pretty much explains the
options.

In a module, type msgbox, highlight it and hit F1


for information on events (sheet activate event for example) see Chip
Pearson's site on events

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy


"jdawg" wrote in message
oups.com...
I just have a quick question. I have a tab called MASTER and I want to
have a message box pop up whenever someone clicks on this MASTER tab
warning them "Changing these two dates, changes all dates in the
headers of the Excel Worksheet." I believe there is a message box that
shows a circle with an X in it and I think you use +vbCritical, but I'm
not positive. Any help would be greatly appreciated.




Harald Staff

Message Box
 
Hi

Rightclick the sheet tab, choose "view code", paste this in

Private Sub Worksheet_Activate()
MsgBox "How dare you, o deadly one !", _
vbOKOnly + vbCritical, "Kneel !"
End Sub

Alter the text to fit you needs.

HTH. Best wishes Harald

"jdawg" skrev i melding
oups.com...
I just have a quick question. I have a tab called MASTER and I want to
have a message box pop up whenever someone clicks on this MASTER tab
warning them "Changing these two dates, changes all dates in the
headers of the Excel Worksheet." I believe there is a message box that
shows a circle with an X in it and I think you use +vbCritical, but I'm
not positive. Any help would be greatly appreciated.




Tom Ogilvy

Message Box
 
Give a man fire and he will be warm the rest of the day
Set a man on fire and he will be warm the rest of his life

<g

--
Regards,
Tom Ogilvy


"Harald Staff" wrote in message
...
Hi

Rightclick the sheet tab, choose "view code", paste this in

Private Sub Worksheet_Activate()
MsgBox "How dare you, o deadly one !", _
vbOKOnly + vbCritical, "Kneel !"
End Sub

Alter the text to fit you needs.

HTH. Best wishes Harald

"jdawg" skrev i melding
oups.com...
I just have a quick question. I have a tab called MASTER and I want to
have a message box pop up whenever someone clicks on this MASTER tab
warning them "Changing these two dates, changes all dates in the
headers of the Excel Worksheet." I believe there is a message box that
shows a circle with an X in it and I think you use +vbCritical, but I'm
not positive. Any help would be greatly appreciated.






bigwheel

Message Box
 
For this you could set an event trigger when selecting the worksheet in
question.
Open the VB editor (Alt+F11) then double click the sheet name in Project
Explorer window. Then select Worksheet and Activate from the two drop down
boxes above the code window and enter

MsgBox "Changing these two dates changes all dates in the headers of the
Excel Worksheets", vbCritical

or just copy this

Private Sub Worksheet_Activate()
MsgBox "Changing these two dates changes all dates in the headers of the
Excel Worksheets", vbCritical
End Sub



Harald Staff

Message Box
 
"Tom Ogilvy" skrev i melding
...
Give a man fire and he will be warm the rest of the day
Set a man on fire and he will be warm the rest of his life


LOL. Thanks Tom.
Best wishes Harald




All times are GMT +1. The time now is 02:54 AM.

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