View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ken Vo
 
Posts: n/a
Default How do I check/uncheck ten or odd Checkboxes by click on one c

Hi Leith,
Thanks for your help but I still can't get it working. What i did was
created numerous of checkboxes and then a command button trhough "Control
Toolbar". Than I click view codes and entered the codes that you had
provided. It didn't do anything. Am i doing something wrong? Please help.
Thanks!

"Leith Ross" wrote:


Hello Ken,

Here are the macros to accomplish your tasks. Add a VBA Module to your
project and copy this code into it. You can assign "ClearCheckboxes" to
one command button and "CheckCheckboxes" to another.

MACRO CODE:
_____________________________

Sub ClearCheckBoxes()

Dim Shp

For Each Shp In ActiveSheet.Shapes
X = Shp.Type
If X = msoFormControl Then
If Shp.FormControlType = xlCheckBox Then
Shp.ControlFormat.Value = False
End If
End If
Next Shp

End Sub

Sub CheckCheckBoxes()

Dim Shp

For Each Shp In ActiveSheet.Shapes
X = Shp.Type
If X = msoFormControl Then
If Shp.FormControlType = xlCheckBox Then
Shp.ControlFormat.Value = True
End If
End If
Next Shp

End Sub
_____________________________

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=497742