View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Count Checkboxes.


for checkboxes from the control toolbox toolbar on a worksheet

Dim obj as OleObject
Dim cnt as Long
Dim chkbx as Msforms.Checkbox
For each obj in Activesheet.OleObject
if typeof obj.Object is MsForms.Checkbox then
set chkbx = obj.Object
if chkbx = True then
cnt = cnt + 1
end if
end if
Next

For forms controls on a worksheet

Dim chkbx as Checkbox
Dim cnt as Long
for each chkbx in Activesheet.Checkboxes
if chkbx.Value = xlOn then
cnt = cnt + 1
end if
Next

--
Regards,
Tom Ogilvy


"Steven" wrote in message
...
Looking for a way to count the number of checkboxes with a check in them.

Thanks for your time,
Steven