Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Cheers Bob
"Bob Phillips" wrote: Private Sub Workbook_BeforeClose(Cancel As Boolean) If Worksheets("Sheet1").Range("A1").Value = False Then MsgBox "Invalid value" End If End Sub Private Sub Workbook_Open() Worksheets("Sheet1").Activate 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 Phillips "Adam Harding" wrote in message ... I am after using a before close statement to check a cell's value and show a message box if true. This would apply across all of my worksheets. I.E. If C1 = False Then Display C1 needs to be True But then still let them close. As an aside is there any way to make sure a front worksheet opens no matter on which worksheet it is closed? Many thanks. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional formatting with a prompt and new email message | Excel Discussion (Misc queries) | |||
#N/A message & Conditional format | Excel Discussion (Misc queries) | |||
conditional formatting error message | Excel Worksheet Functions | |||
changing the message in an error message | Excel Worksheet Functions | |||
Displaying a message in a message box without requiring user to click anything to proceed | Excel Programming |