View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default locking check boxes using a macro

What kind of checkboxes

Control Toolbox Toolbar/ActiveX Checkbox:

for each sh in thisworkbook.Worksheets
for each obj in sh.OleObjects
if typeof Obj.Object is MSForms.Checkbox then
obj.Locked = True
end if
Next
Next

CheckBox from the Forms Toolbar:

for each sh in thisworkbook.Worksheets
for each cbox in sh.CheckBoxes
cbox.Locked = True
next
Next

--
Regards,
Tom Ogilvy


"Erik Andreassen" wrote in
message ...
Hi,

Does anyone know a good way to lock all checkboxes (or other user form
objects) on a worksheet using an excel macro? I have a macro that will

cycle
through all the worksheets in a workbook, and it needs to set the lock
property on all check boxes it finds along the way.


Thanks!