Combo box macro multiple arguments....

ExcelNovice

Well-known Member
Joined
May 12, 2002
Messages
583
I'm trying to use multiple arguments in my combo box macro as shown below, but it does not work....any help will be appreciated:

With Sheets("Sheet1")
If ComboBox2 = "Honda"; "Ford"; "Toyota" Then
.Range("cg219") = 1
Else
.Range("cg219") = 0
End If

End With

Thanks
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
I guess, you better use Checkboxes or ListBox with multiple selections (MultiSelect = frmMultiSelectMulti).
 
Upvote 0
You can't select multiple items in Combobox.
 
Upvote 0
Try this...
Code:
    With Sheets("Sheet1").Range("CG219")
        If ComboBox2.Value = "Honda" Or ComboBox2.Value = "Ford" Or ComboBox2.Value = "Toyota" Then
            .Value = 1
        Else
            .Value = 0
        End If
    End With

Or this...
Code:
    With Sheets("Sheet1").Range("CG219")
        Select Case ComboBox2.Value
            Case "Honda", "Ford", "Toyota"
                .Value = 1
            Case Else
                .Value = 0
        End Select
    End With

Or this...
Code:
    Sheets("Sheet1").Range("CG219").Value = Abs((ComboBox2.Value= "Honda") + (ComboBox2.Value= "Ford") + (ComboBox2.Value = "Toyota"))
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,544
Members
452,925
Latest member
duyvmex

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