#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 460
Default beforesave

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
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
beforesave Patrick Molloy Excel Programming 0 June 11th 09 06:53 PM
BeforeSave Steven Excel Programming 2 January 21st 06 05:37 PM
beforesave and beforeclose Adam Harding Excel Programming 2 July 25th 05 11:11 AM
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 12:18 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"