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

Hello,

I have a sheet with 3 checkboxes from the control tool box. I want to ensure
that the user only selects one checkbox at a time, I want to add validation
then pop a message box instructing the user to only select one at a time.
After the user clicks ok I want to clear all the check boxes.

The issue i have with the code below is when the boxes are cleared the
message pops up again. If all three are checked it pops 3 times. So was
thinking to add an additional validation like if OSCE10=true AND if
OSCE73=true then...elseif OSCE10 and OSCE80=true then if OSCE=false do
nothing?? hmm i am not sure, but the clearing the checkboxes launches the
code again i think and that's why i get the 3 message boxes...

Private Sub OSCE10_Click()
Dim oSheet As Worksheet
Dim oControl As OLEObject
If OSCE73 = True Then
msgbox ("Please only Select One OSCE version at a time.")
With Sheet4
For Each oControl In .OLEObjects
If TypeName(oControl.Object) = "CheckBox" Then
oControl.Object.Value = False
End If
Next oControl
End With
ElseIf OSCE8 = True Then
msgbox ("Please only Select One OSCE version at a time.")
With Sheet4
For Each oControl In .OLEObjects
If TypeName(oControl.Object) = "CheckBox" Then
oControl.Object.Value = False
End If
Next oControl
End With
End If

Thank you for any help you can provide. (suggestions on other ways to
accomplish this would be great.) Access forms has an option group, but i
couldn't find one in excel which is why i am going through the validation code



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default multiple criteria

Wouldn't it be easier just to have radio buttons rather than checkboxes? That
way only one can be chosen within the linked box

"Jessie" wrote:

Hello,

I have a sheet with 3 checkboxes from the control tool box. I want to ensure
that the user only selects one checkbox at a time, I want to add validation
then pop a message box instructing the user to only select one at a time.
After the user clicks ok I want to clear all the check boxes.

The issue i have with the code below is when the boxes are cleared the
message pops up again. If all three are checked it pops 3 times. So was
thinking to add an additional validation like if OSCE10=true AND if
OSCE73=true then...elseif OSCE10 and OSCE80=true then if OSCE=false do
nothing?? hmm i am not sure, but the clearing the checkboxes launches the
code again i think and that's why i get the 3 message boxes...

Private Sub OSCE10_Click()
Dim oSheet As Worksheet
Dim oControl As OLEObject
If OSCE73 = True Then
msgbox ("Please only Select One OSCE version at a time.")
With Sheet4
For Each oControl In .OLEObjects
If TypeName(oControl.Object) = "CheckBox" Then
oControl.Object.Value = False
End If
Next oControl
End With
ElseIf OSCE8 = True Then
msgbox ("Please only Select One OSCE version at a time.")
With Sheet4
For Each oControl In .OLEObjects
If TypeName(oControl.Object) = "CheckBox" Then
oControl.Object.Value = False
End If
Next oControl
End With
End If

Thank you for any help you can provide. (suggestions on other ways to
accomplish this would be great.) Access forms has an option group, but i
couldn't find one in excel which is why i am going through the validation code



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
SUMIFS, one criteria range, multiple criteria GavinS Excel Worksheet Functions 2 September 7th 11 05:40 PM
Count multiple cells against multiple criteria in an Excel spreads EricB Excel Worksheet Functions 7 June 3rd 08 09:09 PM
match multiple criteria ina range from multiple criteria multiplet RG Excel Worksheet Functions 8 September 28th 07 04:21 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Saleem Excel Worksheet Functions 1 January 12th 05 10:54 AM
Counting Cells with multiple criteria.One criteria supporting wild Azhar Arain Excel Worksheet Functions 1 January 12th 05 08:33 AM


All times are GMT +1. The time now is 09:10 AM.

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"