View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_604_] Leith Ross[_604_] is offline
external usenet poster
 
Posts: 1
Default Excel and Visual Basic


Hello Arand,

Copy this macro into a VBA module and then attach the macro to your
command button. It will clear all chekboxes on the active worksheet
automatically.


Code:
--------------------

Sub ClearCheckBoxes()

Dim AutoShape

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

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=555428