View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Andreas Emmert Andreas Emmert is offline
external usenet poster
 
Posts: 2
Default Unset shape checkboxes with VBA

Sorry, found the solution myself ...


Dim c As Shape

For Each c In ActiveSheet.Shapes
If Left(c.Name, 8) = "CheckBox" Then
ActiveSheet.OLEObjects(c.Name).Object.Value = 0
End If
Next c

--
Andreas

"Andreas Emmert" schrieb im Newsbeitrag
...
Hi NG,

I've got about 60 checkboxes on my spreadsheet (not in a user form!) and

I'd
like to unset these checkboxes with VBA. So far I've come up with the
following:

Dim c As Shape

For Each c In ActiveSheet.Shapes
If Left(c.Name, 8) = "CheckBox" Then
ActiveSheets.Shapes.Object.Value = 0
End If
Next c

However, I cannot change the value, i.e. whether or not the checkboxes are
set or not. How do I address these shapes/checkboxes and set them to
unchecked?

--
Andreas