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

for each obj in ActiveSheet.OleObjects
if typeof Obj.Object is MSForms.CheckBox then
obj.Object.Value = False
end if
Next

or
if the names of the checkboxes are of the form A# then

for i = 1 to 10
Activesheet.OleObjects("A" & i).Object.Value = False
Next

The above is for checkboxes from the control toolbox toolbar. If from the
forms toolbar


for each cbox in Activesheet.CheckBoxes
cbox.Value = xlOff
Next


or

for i = 1 to 10
activesheet.Checkboxes("A" & i).Value = xlOff
Next

or if only 10 checkboxes

for i = 1 to 10
activesheet.Checkboxes(i).Value = xloff
Next

--
Regards,
Tom Ogilvy


"terrysoper1973"
<terrysoper1973.21ahza_1136679602.1953@excelforu m-nospam.com wrote in
message news:terrysoper1973.21ahza_1136679602.1953@excelfo rum-nospam.com...

Dim Ndx As Long
For Ndx = 1 To 2
UserForm1.Controls("A" & Ndx).Value = False
Next Ndx

My checkboxes are in the workbook and not on a form. I'm just not
understanding the code.

I tried to type the code in but got an error message "type missmatch"

So I tried the following
Dim Ndx As Long
For Ndx = 1 To 2
worksheets("sheet1").Controls("A" & Ndx).Value = False
Next Ndx

Well maybe I get marks for creativity
I may be in over my head. So if you think your waisting your time, I
won't be offended, but I do welcome your help.

Thanks
Dennis


--
terrysoper1973
------------------------------------------------------------------------
terrysoper1973's Profile:

http://www.excelforum.com/member.php...o&userid=30161
View this thread: http://www.excelforum.com/showthread...hreadid=498925