LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default beforesave

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
'In the "Enclosure" section of the form, looks at checkboxes for Sound
' Attenuated, Super Sound Attenuated, and cell H33. If one is checked on and
'H33 is blank then don't allow Save.

If ( cbSA.Enabled OR cbSSA.Enabled ) AND Range("H33").Value = "" Then
Cancel = True
MsgBox "You have not specified a sound attenuation requirement.") & _
("This sheet will not be saved until you furnish this information" vbOKOnly

End If
End Sub

"Doug" wrote in message
...
I am working on a form for our salesmen. I have a series of checkboxes
that
are available and when one is checked on or enabled the others are
disabled.
What I want to do with two of these when the salesman tries to save the
form
is have it check for these two checkboxes to see if one is on/enabled and
if
so then check a cell to make sure it has been filled out. If not then you
get
a message asking you to fill in the requirement. The code is on
ThisWorkbook,
I would appreciate any help.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
'In the "Enclosure" section of the form, looks at checkboxes for Sound
Attenuated, Super Sound Attenuated, and cell H33. If one is checked on and
H33 is blank then don't allow Save.

If cbSA.Enabled = True And Range("H33").Value = "" Then
Cancel = True
If cbSSA.Enabled = True And Range("H33").Value = "" Then
Canel = True

MsgBox("You have not specified a sound attenuation requirement.") &
("This sheet will not be saved until you furnish this information"
vbOKOnly)
If a = vbOKOnly Then Cancel = True

End If
End If
End Sub


 
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
BeforeSave and Close help Alex Excel Programming 9 February 7th 06 07:36 PM
BeforeSave Steven Excel Programming 2 January 21st 06 05:37 PM
BeforeSave event Carl Bowman Excel Discussion (Misc queries) 4 February 6th 05 12:28 PM
BeforeSave Sub Phil Hageman[_3_] Excel Programming 6 January 14th 04 10:12 AM
VBA - BeforeSave - NEED HELP HRobertson Excel Programming 2 October 23rd 03 06:50 PM


All times are GMT +1. The time now is 11:14 PM.

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"