combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wrote an If statement to drive the list fill range of a combo box. It
worked till I added the second if now my result is alwats "ratelookup".
Can anyone figure out what I messed up on the syntax ?
Thanks,
Yosef


Private Sub ComboBox3_GotFocus()

If Range("b2").Value = "Alt A Second" Then

ComboBox3.ListFillRange = "ratelookups"

If Range("b2").Value = "Alt A+ Second" Then

ComboBox3.ListFillRange = "ratelookup2"

Else: ComboBox3.ListFillRange = "ratelookup"

End If

End If

End Sub
 
Try adding an "ELSE:" before the second IF statement, like this:

ComboBox3.ListFillRange = "ratelookups"
Else:
If Range("b2").Value = "Alt A+ Second" Then

HTH,
Elkar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top