Macro question

J

John

I have a spreadsheet with simple check boxes.
I want to check a check box and if checked another check box is
automatically ticked.

I have managed to get it to select another check box but not actually place
a check inside the check box.

Anyone got any ideas?

Many thanks
 
B

Bob Phillips

In the macro assigned to the one checkbox add

If ActiveSheet.CheckBoxes("Check Box 1").Value = 1 Then
ActiveSheet.CheckBoxes("Check Box 2").Value = True
End If


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
J

John

Hello,

Thanks for your help but unfortunately it didn't help. I have used something
similar to your solution before but dor a combo box and not a check box.

Just for you to see the check box sub really is simple - I just have the
following

Private Sub CheckBox1_Click()

End Sub

Do you have any other suggestions?

Thanks
John
 
B

Bob Phillips

What sort of checkbox is it?

Controls checkbox?

Private Sub CheckBox1_Click()
If Me.CheckBox1.Value Then
Me.CheckBox2.Value = True
End If
End Sub

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
J

John

Hello,

Thanks for that - this works fine - I changed it a little but the idea is
what is important - thanks

What sort of checkbox is it? - It is a check box I drew in a form.

Thanks
 
B

Bob Phillips

I answered my own question John, for confirmation. As it happens I got it
wrong <LOL>. Originally I assumed it was a forms checkbox on a worksheet.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
J

John

Hello,

Thanks again - maybe you can answer one more thing for me that is driving me
up the wall.

I have the following

Private Sub CheckBox3_Click()
Rows("11:11").Select
Selection.EntireRow.Hidden = True

End Sub

The only problem is that the row hides perfectly but the check box stays !!
Do you know how to hide the check box as well?

Thanks
John
 
B

Bob Phillips

Private Sub CheckBox3_Click()
Me.Rows(11).Hidden = True
Me.CheckBox3.Visible = False
End Sub



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Top