Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option Box on Workbook Close
I want to create an option box that opens when the value of a cell ="no"
which is populated when =if(A1=A2,"yes","no") when a user trys to close a workbook. The option box will have "yes" or "no" options where "yes" will go to cell A1 and "no" will close the workbook. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Option Box on Workbook Close
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Worksheets("Sheet1").Range("M1").Value = "yes" then '<==change M1 to suit Application.Goto Worksheets("Sheet1").Range("A1") Cancel = True 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) "Tony" wrote in message ... I want to create an option box that opens when the value of a cell ="no" which is populated when =if(A1=A2,"yes","no") when a user trys to close a workbook. The option box will have "yes" or "no" options where "yes" will go to cell A1 and "no" will close the workbook. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding a Close Workspace option when right-clicking Excel in taskb | Setting up and Configuration of Excel | |||
close email option | Excel Discussion (Misc queries) | |||
Disable option save when close excel | Excel Programming | |||
Option in Excel to save a close a workbook inactive for 5 minutes | Excel Discussion (Misc queries) | |||
Resetting menu option on close... | Excel Programming |