ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Wildcard Usage in Combo Box Programming (https://www.excelbanter.com/excel-programming/424983-wildcard-usage-combo-box-programming.html)

BJ

Wildcard Usage in Combo Box Programming
 
I have a combo box that has groups of similar options - for example:

Option1 (Term1)
Option1 (Term2)
Option2 (Term1)
Option2 (Term2)

etc.

I need the same event to occur by group - that is, whether it is Option1
(Term1) or Option1 (Term2) I would like the same event to occur.

How can I refer to the choices in the combo box in an IF statement without
using OR multiple times? Is there a way to use a wildcard?

If ComboBox1.Value = "Option1 (Term1)" or "Option1 (Term2)" or ... or ... or

Thanks.


Charlie

Wildcard Usage in Combo Box Programming
 
If Left(ComboBox1.Value, 7) = "Option1" Then
...
End If


"BJ" wrote:

I have a combo box that has groups of similar options - for example:

Option1 (Term1)
Option1 (Term2)
Option2 (Term1)
Option2 (Term2)

etc.

I need the same event to occur by group - that is, whether it is Option1
(Term1) or Option1 (Term2) I would like the same event to occur.

How can I refer to the choices in the combo box in an IF statement without
using OR multiple times? Is there a way to use a wildcard?

If ComboBox1.Value = "Option1 (Term1)" or "Option1 (Term2)" or ... or ... or

Thanks.



All times are GMT +1. The time now is 03:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com