View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Unchecking check boxes on exit

I'd uncheck them the next time the workbook opens. It makes life easier.

Where are the checkboxes (on a single worksheet?)

How were they created (from the Forms toolbar or the control toolbox toolbar)

Option Explicit
Sub auto_open()
Dim wks As Worksheet
Dim OLEObj As OLEObject

Set wks = Worksheets("sheet1")

If wks.CheckBoxes.Count 0 Then
wks.CheckBoxes.Value = xlOff
End If

For Each OLEObj In wks.OLEObjects
If TypeOf OLEObj.Object Is MSForms.CheckBox Then
OLEObj.Object.Value = False
End If
Next OLEObj
End Sub



Brisbane Rob wrote:

I assume there must be a way of unchecking all checkboxes on exit but I
can't find it. VBA code? Anyone know?

Thanks

--
Brisbane Rob
------------------------------------------------------------------------
Brisbane Rob's Profile: http://www.excelforum.com/member.php...o&userid=25096
View this thread: http://www.excelforum.com/showthread...hreadid=512179


--

Dave Peterson