If ComboBox contains...

Krosis

New Member
Joined
Sep 10, 2021
Messages
23
Office Version
  1. 365
Platform
  1. Windows
So, I have created a userform that has multiple combo boxes with Options 1,2 and 3 across a 7 page multipage. I need help in figuring out how it can check for any instance of say “Option 1” in any of the combo boxes and then pasting that value in a textbox at the beginning of the multipage (overview page).

Hopefully that makes sense!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Spent a couple hours trying to figure something out but all dead ends :( any suggestions would be great. If you need more info let me know!
 
Upvote 0
Spent a couple hours trying to figure something out but all dead ends :( any suggestions would be great. If you need more info let me know!
I looked at your question but had numerous questions. Can you be more specific.
Like what does this mean:
Options 1,2 and 3
What is a Option?

And this:
then pasting that value in a textbox at the beginning of the multipage (overview page).

And like this:
beginning of the multipage (overview page).
beginning ???
You may get help easier if you said on Mutipage1 Tab named Alpha Textbox named "Bravo"
 
Upvote 0
My Apologies! After looking back at what I originally typed I understand I wasn’t clear at all. I’m new to all this so I’m not 100% how to best explain.

So let me try again...
I have a number of questions a client needs to answer with 3 possible outcomes. Let’s say those outcomes are “Green” “Red” and “N/A”. If the client selects “Green” or “N/A” for all the ComboBoxes (questions) I need the value in a textbox to display “Green”. If at any point the client selects “Red” to any of the ComboBoxes I need the value in the textbox to display as “Red”.

Thanks in advance!
 

Attachments

  • 1.png
    1.png
    1.7 KB · Views: 5
  • 2.png
    2.png
    1.8 KB · Views: 5
Upvote 0
OK those are more details.

So when would the script run?
When a user does something the Excel script will run

This is clear:
If at any point the client selects “Red” to any of the ComboBoxes I need the value in the textbox to display as “Red”.

But this is not clear:
If the client selects “Green” or “N/A” for all the ComboBoxes (questions) I need the value in a textbox to display “Green”

So when would the script run?

So if the user has 5 comboboxes the script would have to wait till all comboboxes have a value selected.
 
Upvote 0
OK those are more details.

So when would the script run?
When a user does something the Excel script will run

This is clear:
If at any point the client selects “Red” to any of the ComboBoxes I need the value in the textbox to display as “Red”.

But this is not clear:
If the client selects “Green” or “N/A” for all the ComboBoxes (questions) I need the value in a textbox to display “Green”

So when would the script run?

So if the user has 5 comboboxes the script would have to wait till all comboboxes have a value selected.
The idea currently would be that when the client presses a submit button the Data is transfered into certain cells which can then be saved or printed etc. So upon selecting a commandbutton I would think unless you have another suggestion.

By If the client selects “Green” or “N/A” for all the ComboBoxes (questions) I need the value in a textbox to display “Green” A better way to explain it might be as pass or fail. If the uses Selects "Pass" for everything then the overall score would be a pass and the textbox would display "Pass". If however the user selects "Fail" for any of the comboboxes then the overall score would be a "fail" and the textbox would display "Fail"
 
Upvote 0
Managed to figure it out with..
VBA Code:
If ComboBox1.value = "Fail" Then
TextBox10.value = "Fail"
Else
TextBox10.value = "Pass"
End If
Makes my code a little longer than id like with the amount of ComboBoxes I have but it works! Thanks for Advice and helping me figure out my own question :D
 
Upvote 0
Managed to figure it out with..
VBA Code:
If ComboBox1.value = "Fail" Then
TextBox10.value = "Fail"
Else
TextBox10.value = "Pass"
End If
Makes my code a little longer than id like with the amount of ComboBoxes I have but it works! Thanks for Advice and helping me figure out my own question :D
If you would show me all your code I may be able to shorten it for you.
 
Upvote 0
So I thought I figured it out but it seems I have!.. Code below (its a mess I know). Its just a copy paste taking into account the different combo boxes however the issue im finding now is as follows...

I need Textbox10.Value to display "Standard Met" unless a "Standard Not Met" has been selected in any of the Combo Boxes. Curreently the most recent ComboBox updated is the Value Displayed in Textbox10. Hopefully someone can help!

VBA Code:
Private Sub ComboBox1_Change()

If ComboBox1.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox10_Change()
If ComboBox10.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox14_Change()
If ComboBox14.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox15_Change()
If ComboBox15.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox2_Change()
If ComboBox2.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox3_Change()
If ComboBox3.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox4_Change()
If ComboBox4.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox40_Change()
If ComboBox40.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox41_Change()
If ComboBox41.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox42_Change()
If ComboBox42.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox43_Change()
If ComboBox43.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox5_Change()
If ComboBox5.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox53_Change()
If ComboBox53.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox54_Change()
If ComboBox54.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox55_Change()
If ComboBox55.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox59_Change()
If ComboBox59.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox6_Change()
If ComboBox6.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox60_Change()
If ComboBox60.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox61_Change()
If ComboBox61.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox62_Change()
If ComboBox62.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox63_Change()
If ComboBox63.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox64_Change()
If ComboBox64.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox65_Change()
If ComboBox65.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox66_Change()
If ComboBox66.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox67_Change()
If ComboBox67.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox68_Change()
If ComboBox68.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox69_Change()
If ComboBox69.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox7_Change()
If ComboBox7.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox70_Change()
If ComboBox70.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox71_Change()
If ComboBox71.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox72_Change()
If ComboBox72.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox73_Change()
If ComboBox73.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox74_Change()
If ComboBox74.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox75_Change()
If ComboBox75.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox76_Change()
If ComboBox76.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox77_Change()
If ComboBox77.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox78_Change()
If ComboBox78.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox79_Change()
If ComboBox79.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox8_Change()
If ComboBox8.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox80_Change()
If ComboBox80.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub

Private Sub ComboBox9_Change()
If ComboBox9.value = "Standard Not Met" Then
TextBox10.value = "Standard Not Met"
Else
TextBox10.value = "Standard Met"
End If
End Sub
 
Upvote 0
After a couple of hours away from my desk I was able to come back with a fresh(ish) pair of eyes and have another crack at the above code. I havent been able to make it any shorted however I seem to have figured out how code it so the most recent commandbutton doesnt override the previous outcome (if that makes sense?). Iv pasted the example for 2 Comboboxes below to avoid a big copy/paste like last time. Any advice on simplifying the code would be great!


Code removed.. It seems after going back and testing it for a second time my issue hasnt been solved. Back to the drawing board!
 
Upvote 0

Forum statistics

Threads
1,214,981
Messages
6,122,566
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top