Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 126
Default Check and clear Multiple check boxes

When you click on CheckBox1 and it does something to Checkbox2, the Change
AND Click methods in CheckBox2 fire up. You have to work your code around
that situation.
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Dean" wrote:

Ryan, this will clear all the check boxes. I only want the five related to
each question clearing.

Gary,this is the code I currently use and it seams that it is re-checking
each checkbox when they are changed.
the code is in the "Click" event. When I click A1 it clears A2,A3,A4,A5 but
runs the code in A2, A3, A4, A5 as if I had clicked them.

Dean

"ryguy7272" wrote:

This will clear all CheckBoxes:
Sub ClearCheckBoxes()
Dim ChkBox As Object
For Each ChkBox In ActiveSheet.CheckBoxes
ChkBox.Value = xlOff
Next ChkBox
End Sub


This will clear all ActiveX CheckBoxes:
Sub UnCheckBoxesActiveX()
Dim objChkBox As OLEObject
With Sheets("Clear All Check Boxes")
For Each objChkBox In .OLEObjects
If TypeName(objChkBox.Object) = "CheckBox" Then
objChkBox.Object.Value = False
End If
Next
End With
End Sub

Modify to suit.

--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Gary Brown" wrote:

Example assumes there are 3 checkboxes...
When Checkbox1 is checked/unchecked, checkboxes 2 & 3 are unchecked.
Do the Same type of procedure with checkboxes 2 & 3.

Private Sub CheckBox1_Click()
CheckBox2.Value = False
CheckBox3.Value = False
End Sub

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"Dean" wrote:

I have about 20 check boxes on sheet1 of a spreadsheet from the Controls tool
box.
5 of them are loners and should not be touched in regard to the remaining 15.
The 15 are Very good, Good, Ok, Bad, Very Bad answers...
Q1 A1,2,3,4,5
Q2 A1,2,3,4,5
Q3 A1,2,3,4,5

I want to be able be click an answer on Q1 and have the code untick all the
other answers for Q1 but not Q2 or Q3, then tick any one of the answers on Q2
and have the code untick all the other boxes on Q2 and same for Q3.
If however the user changes their mind on Q? the code should untick all the
other answers on that Q.

I have (at work) some working code but checking through it on Debug, step
into it jumps backwards and forwards through each of the checkbox?_click()
subs.

Can someone suggest some code to do the above please?

Thanks
Dean

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
Clear check boxes? Dave Peterson Excel Programming 0 December 1st 09 08:12 PM
Clear check boxes? Geoff[_5_] Excel Programming 0 December 1st 09 08:09 PM
Clear check boxes? Geoff[_5_] Excel Programming 1 December 1st 09 07:14 PM
Clear All Check Boxes Steve C Excel Programming 5 March 15th 07 09:38 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 07:17 PM.

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

About Us

"It's about Microsoft Excel"