LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
KL KL is offline
external usenet poster
 
Posts: 201
Default Conditional Closing and Saving

Hi Adam,

You could use the BeforeSave and BeforeClose events of ThisWorkbook, e.g.:

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = (Me.Sheets(1).Cells(1, 1) = _
Me.Sheets(2).Cells(1, 1))
End Sub

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
Cancel = (Me.Sheets(1).Cells(1, 1) = _
Me.Sheets(2).Cells(1, 1))
End Sub


Regards,
KL


"Adam Harding" wrote in message
...
Am using Excel 2003. Want to stop users exiting or saving my spreadsheet
unless the total on one sheet = total on other sheet.

How can this be done?

Any help gratefully received



 
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
Saving and closing erf Setting up and Configuration of Excel 4 June 18th 08 06:52 PM
Saving and Closing erf Excel Worksheet Functions 3 June 18th 08 05:03 PM
Saving and Closing erf Excel Discussion (Misc queries) 1 June 18th 08 08:38 AM
closing & saving rufusf Excel Worksheet Functions 2 March 5th 06 09:37 AM
VBA - closing without saving changes ajliaks[_14_] Excel Programming 2 April 21st 04 09:28 PM


All times are GMT +1. The time now is 03:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"