Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 313
Default toggling checkboxes

I want to add several checkboxes to the worksheet and to have them working
similar to option box, so that only one can be selected in any particulart
time. I have created several procedures acting on CheckBox_click event but I
can not figure on how to set the values for other checkboxes. Using

CheckBox2.Value = False

or

CheckBox2.Value = 0

does not work, I am getting error messages related to missing objects. How
my code should look like ? Thanks for help.

Regards,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default toggling checkboxes

hi
here is one way to do it. you may have to work your other code in/around it.
the trick is that if one checkbox is true(checked) the others are set to
false with all checkboxes looking at all the other checkboxes.
Private Sub CheckBox1_Click()
If CheckBox1 = True Then
CheckBox2 = False
CheckBox3 = False
End If
End Sub

Private Sub CheckBox2_Click()
If CheckBox2 = True Then
CheckBox1 = False
CheckBox3 = False
End If
End Sub

Private Sub CheckBox3_Click()
If CheckBox3 = True Then
CheckBox1 = False
CheckBox2 = False
End If
End Sub

regards
FSt1

"Tony" wrote:

I want to add several checkboxes to the worksheet and to have them working
similar to option box, so that only one can be selected in any particulart
time. I have created several procedures acting on CheckBox_click event but I
can not figure on how to set the values for other checkboxes. Using

CheckBox2.Value = False

or

CheckBox2.Value = 0

does not work, I am getting error messages related to missing objects. How
my code should look like ? Thanks for help.

Regards,

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
Help with toggling display Tom Excel Discussion (Misc queries) 3 June 28th 09 12:55 PM
toggling between 2 workbooks excelnut1954 Excel Programming 1 October 12th 06 08:31 PM
toggling jlofritts Excel Worksheet Functions 3 March 7th 06 06:34 PM
Toggling autofit rgarber50 Excel Discussion (Misc queries) 2 September 4th 05 07:40 AM
toggling a chart on and off VILLABILLA Excel Programming 3 February 26th 04 10:25 AM


All times are GMT +1. The time now is 03:55 AM.

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"