ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Can I insert a pop up window in Excel to ask a ? b/4 closing? (https://www.excelbanter.com/excel-discussion-misc-queries/87622-can-i-insert-pop-up-window-excel-ask-b-4-closing.html)

Bernadette

Can I insert a pop up window in Excel to ask a ? b/4 closing?
 
I would like to create a pop up box simular to the one that appears when you
are closing your document and are asked to save. Is there a function to
allow you to create your own pop up window and questions?

Ardus Petus

Can I insert a pop up window in Excel to ask a ? b/4 closing?
 
Create an event handler for Before_Close event in workbook's code.
Show an user-defined Userform

HTH
--
AP

"Bernadette" a écrit dans le message
de news: ...
I would like to create a pop up box simular to the one that appears when
you
are closing your document and are asked to save. Is there a function to
allow you to create your own pop up window and questions?




Bob Umlas, Excel MVP

Can I insert a pop up window in Excel to ask a ? b/4 closing?
 
This is done by using VBA.
Try: Alt/F11, then Insert/Module, then enter this:
Sub Test()
answer=msgbox("Do you want to go to sleep now?",vbyesno)
if answer =vbyes then msgbox "Good night" else msgbox "Good day!"
End Sub

then Alt/F11 again, then in Excel use Alt/F8, double-click Test & you'll see
this example.

"Bernadette" wrote:

I would like to create a pop up box simular to the one that appears when you
are closing your document and are asked to save. Is there a function to
allow you to create your own pop up window and questions?



All times are GMT +1. The time now is 05:07 PM.

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