Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Simple meassage box

Could someone tell me how to have a message box pop up when someone opens a
file. The message box should have 'yes' and 'no' buttons and should be asking
you to check you are in the correct spreadsheet. If 'yes' is selected then
continue on to edit the sheet, if 'no' is selected, then close Excel.
Any help is greatly appreciated.
Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Simple meassage box

In the workbook to be opened, add


Private Sub Workbook_Open()
If MsgBox("question", vbYesNo) = vbNo Then
Application.Quit
End If
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Les" wrote in message
...
Could someone tell me how to have a message box pop up when someone opens
a
file. The message box should have 'yes' and 'no' buttons and should be
asking
you to check you are in the correct spreadsheet. If 'yes' is selected then
continue on to edit the sheet, if 'no' is selected, then close Excel.
Any help is greatly appreciated.
Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
Les Les is offline
external usenet poster
 
Posts: 240
Default Simple meassage box

Cheers Bob

Exactly what I needed.

Regards

Les.


"Bob Phillips" wrote:

In the workbook to be opened, add


Private Sub Workbook_Open()
If MsgBox("question", vbYesNo) = vbNo Then
Application.Quit
End If
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Les" wrote in message
...
Could someone tell me how to have a message box pop up when someone opens
a
file. The message box should have 'yes' and 'no' buttons and should be
asking
you to check you are in the correct spreadsheet. If 'yes' is selected then
continue on to edit the sheet, if 'no' is selected, then close Excel.
Any help is greatly appreciated.
Thanks.




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


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF formula-simple question; simple operator Rich D Excel Discussion (Misc queries) 4 December 6th 07 03:36 PM
Simple problem, simple formula, no FUNCTION ! Ron@Buy Excel Worksheet Functions 6 September 28th 07 04:51 PM
Simple Simple Excel usage question BookerW Excel Discussion (Misc queries) 1 June 23rd 05 10:06 PM
Can I add a Warning Meassage to a Macros Designed to Delete a Row C Bonovich Excel Worksheet Functions 1 June 2nd 05 07:32 AM
Make it more simple or intuitive to do simple things Vernie Charts and Charting in Excel 1 March 16th 05 04:01 AM


All times are GMT +1. The time now is 04:02 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"