Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Save As Macro only if Check Boxes...

I have a command button that I would like to be able to use as a Save
As button. However on my form I have Check Box 12, 13, 14 that all
MUST be checked in order for the Macro to funtion and allow somebody to
Save. I would also really like to have a Comment window pop up
explaining why the command button is not working if they have not
checked off all 3 boxes. Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Save As Macro only if Check Boxes...

I put 4 checkboxes from the control toolbox toolbar on a worksheet.

I put a commandbutton from that same toolbar on the same worksheet.

This was the code under the commandbutton:

Option Explicit

Private Sub CommandButton1_Click()
If Me.CheckBox1.Value = True _
And Me.CheckBox2.Value = True _
And Me.CheckBox3.Value = True _
And Me.CheckBox4.Value = True Then
'ok to save
Me.Parent.Save
Else
MsgBox "Please check all those boxes!" & vbLf & "Workbook not saved!"
End If
End Sub


You'll have to change the names (checkbox1 becomes checkbox14, etc).

JoePro82 wrote:

I have a command button that I would like to be able to use as a Save
As button. However on my form I have Check Box 12, 13, 14 that all
MUST be checked in order for the Macro to funtion and allow somebody to
Save. I would also really like to have a Comment window pop up
explaining why the command button is not working if they have not
checked off all 3 boxes. Thanks in advance.


--

Dave Peterson
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
Clearing All check boxes using Macro Anil Kumar N. Excel Discussion (Misc queries) 4 December 27th 07 10:40 AM
Can one macro serve several check boxes? Naum Charts and Charting in Excel 3 November 16th 07 04:55 PM
Clearing Check Boxes & Running a diff Macro when unchecking the ch Vick Excel Discussion (Misc queries) 6 May 30th 07 08:44 PM
locking check boxes using a macro Erik Andreassen[_2_] Excel Programming 3 June 24th 05 07:40 PM
inserting check boxes from a macro morry[_13_] Excel Programming 2 February 27th 04 07:25 PM


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