Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JK JK is offline
external usenet poster
 
Posts: 78
Default Can I Group Form Check Boxes?

I have 90 checkboxes on a worksheet and a CmdBtn to clear the selections. Is
there a way to group the checkboxes so I can clear them in one simple
procedure? Or am I stuck having to list each checkbox separately in a
procedure like If Sheets("Sheet1).CheckBox1.Value=True Then
Sheets("Sheet1).CheckBox1.Value=False, etc.

Thank you.
Regards,
Jim Kobzeff



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Can I Group Form Check Boxes?

do you mean forms as in checkboxes from the forms toolbar (or do you mean
activeX checkboxes from the control toolbox toolbar also known as MSForms).

for the first

Activesheet.Checkboxes.Value = xloff

for the 2nd

for each ctrl in Worksheets("Sheet1").OleObjects
if typeof ctrl is MSforms.CheckBox then
set cb = ctrl.Object
cb.Value = False
end if
Next


But it sounds like you want to work on a subset of the checkboxes.

If so, I would use the topleftcell property test its location on the sheet
with the intersect method

if not intersect(ctrl.TopLeftCell, Range("A1:F20")) is nothing then
ctrl.object.Value = False
End if

you can use similar with the controls from the Forms toolbar

for each cb in Worksheets("Sheet1").Checkboxes
if not intersect(cb.TopLeftCell, Range("A1:F20")) is nothing then
cb.Value = xlOff
end if
Next


--
Regards,
Tom Ogilvy

"JK" wrote in message news:MBpWc.34$6b.32@trnddc04...
I have 90 checkboxes on a worksheet and a CmdBtn to clear the selections.

Is
there a way to group the checkboxes so I can clear them in one simple
procedure? Or am I stuck having to list each checkbox separately in a
procedure like If Sheets("Sheet1).CheckBox1.Value=True Then
Sheets("Sheet1).CheckBox1.Value=False, etc.

Thank you.
Regards,
Jim Kobzeff





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA for form check boxes dicko1 Excel Worksheet Functions 4 June 5th 09 04:02 PM
copy check boxes (made from form toolbar) hoffjero Excel Discussion (Misc queries) 6 February 4th 09 11:20 PM
VBA code for the Check Boxes in a form HKS Excel Discussion (Misc queries) 3 June 24th 08 09:42 PM
How do I create a Form with check boxes in Excel Not Super User Excel Worksheet Functions 1 June 28th 07 05:08 PM
Enable check box in protected sheet + group check boxes Dexxterr Excel Discussion (Misc queries) 4 August 2nd 06 12:00 PM


All times are GMT +1. The time now is 11:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"