PDA

View Full Version : Solved: check box logic



austenr
08-19-2010, 06:41 AM
Is this not the right way to check if a check box has a check in it. I am trying to use this code but it fails on the .CheckBoxes part.

If Sheets("Input + Wksheet").Range("G6").Value >= 65 And Sheets("Input + Wksheet").Range("G7").Value < 65 _
And Sheets("Input + Wksheet").CheckBoxes("Check Box 87").Value = True Then

Bob Phillips
08-19-2010, 06:44 AM
No, check it for xlOn not True, True is ActiveX checkboxes.

austenr
08-19-2010, 06:44 AM
thanks Bob

austenr
08-19-2010, 06:47 AM
so to clear it you would say

sheets("Input + Wksheet).CheckBoxes("Check Box 87").Value = xlOff ?

Bob Phillips
08-19-2010, 07:08 AM
Do you know, I assumed yes, but I didn't know for sure, so I tried it :)

The answer is yes.

austenr
08-19-2010, 07:12 AM
Thanks, its ok we dont expect you to know everything. Thanks :thumb

Bob Phillips
08-19-2010, 07:16 AM
Thanks, its ok we dont expect you to know everything. Thanks :thumb

What I wondered when I read your post was whether I had ever had cause to clear it like that. Being a checkbox, I can't think why I would clear it, so I would maybe never have done it. Why do you need to clear it?

austenr
08-19-2010, 07:25 AM
Well, the check box is a series of three on a sheet. this sheet is used over and over again for different scenario's. So I have a clear button that clears all the input cells and now I needed to know how to clear the check boxes so another scenario can be executed. Sometimes the check boxes come into play sometimes they dont. HTH

Bob Phillips
08-19-2010, 07:45 AM
Okay, I see. I figured afterwards why it hasn't been an issue for me, I tend to avoid controls on a worksheet, I either have a menu, or a form.

austenr
08-19-2010, 08:09 AM
Sometimes you need to work with what you HAVE to. Not my idea. Thanks Bob.