Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 313
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,726
Default 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
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
Adding a Close Workspace option when right-clicking Excel in taskb Handsome Prints Setting up and Configuration of Excel 0 September 4th 09 03:34 AM
close email option Malinda Excel Discussion (Misc queries) 2 August 24th 08 09:54 PM
Disable option save when close excel Rui Alvares Excel Programming 2 March 15th 06 01:59 AM
Option in Excel to save a close a workbook inactive for 5 minutes Patricia Peterson Excel Discussion (Misc queries) 4 January 5th 06 05:00 PM
Resetting menu option on close... Tom Ogilvy Excel Programming 0 July 27th 04 07:04 PM


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