Hi All, Is there any code I can add to a macro that will untick a given tic box if it is ticked
T The Grinch Jul 19, 2004 #1 Hi All, Is there any code I can add to a macro that will untick a given tic box if it is ticked
K Kelly n español Jul 19, 2004 #2 when you say "tick box," do you mean a check box like those check boxe that are found in the options dialog? If there are specific options that are checked and you want to deselec them then that is definitely possible. I'm just not sure which boxes you are referring to..
when you say "tick box," do you mean a check box like those check boxe that are found in the options dialog? If there are specific options that are checked and you want to deselec them then that is definitely possible. I'm just not sure which boxes you are referring to..
T The Grinch Jul 19, 2004 #3 They're actually called "Check boxes", they are little tickable boxe selected from the control toolbar
They're actually called "Check boxes", they are little tickable boxe selected from the control toolbar
K Kelly n español Jul 19, 2004 #4 Try this: (I only tested it on two workbooks, but so far it is working for me) Code ------------------- Sub Make_All_Boxes_False() Dim myObject As OLEObject For Each myObject In ActiveSheet.OLEObjects If InStr(1, myObject.ProgId, "CheckBox", vbBinaryCompare) > 1 Then myObject.Object.Value = False End If Next End Su ------------------- Please let me know how it turns out. -Kell
Try this: (I only tested it on two workbooks, but so far it is working for me) Code ------------------- Sub Make_All_Boxes_False() Dim myObject As OLEObject For Each myObject In ActiveSheet.OLEObjects If InStr(1, myObject.ProgId, "CheckBox", vbBinaryCompare) > 1 Then myObject.Object.Value = False End If Next End Su ------------------- Please let me know how it turns out. -Kell
K Kelly n español Jul 19, 2004 #5 Oh, I almost forgot... changing the line: myObject.Object.Value = False to myObject.Object.Value = True ... would, of course, set all of the check boxes to "checked" status -Kelly ______________________ 'Have a laugh at my web site (http://kellyjones.netfirms.com/spanish/gazapos.html#english-gazapos
Oh, I almost forgot... changing the line: myObject.Object.Value = False to myObject.Object.Value = True ... would, of course, set all of the check boxes to "checked" status -Kelly ______________________ 'Have a laugh at my web site (http://kellyjones.netfirms.com/spanish/gazapos.html#english-gazapos
B Bob Phillips Jul 19, 2004 #6 What should happen if it is not? If it is to stay unchecked then With ActiveSheet .OLEObjects("Checkbox1").Object.Value = False End With If it should change also then With ActiveSheet.OLEObjects("Checkbox1").Object .Value = Not .Value End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct)
What should happen if it is not? If it is to stay unchecked then With ActiveSheet .OLEObjects("Checkbox1").Object.Value = False End With If it should change also then With ActiveSheet.OLEObjects("Checkbox1").Object .Value = Not .Value End With -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct)