• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Cross referencing ComboBoxes

Hello all,

Back again looking for what I suspect is an easy fix:

Combobox1 has a list from 1 to 26
Combobox2 has a list from A to Z (see where I'm going with this ;-])

I'd like it that if the User selects Combobox1 and picks 5 than Combobox2 Vlookups and returns E.

I would also like it if the User selects Combobox2 and picks E then Combobox1 Vlookups and returns 5.

I'm guessing this should be a fairly simple macro, but I'm not finding one.

Thanks in advance.
 
Why not just use ListBox? It can hold more than 1 column and as well, have only 1 visible and return hidden value on selection.

For combobox, just use .ListIndex property.
-1 since it's base zero index.
Code:
Private Sub ComboBox1_Change()
If Len(ComboBox1.Value) > 0 Then
    ComboBox2.ListIndex = ComboBox1.Value - 1
End If
End Sub
 
Back
Top