View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
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