Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 "ynissel" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks - perfect !
Stupid mistake and screwed me for half a day !! "Elkar" wrote: 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 "ynissel" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Combo Box | Excel Worksheet Functions | |||
Nesting Combo Boxes /Returning an Array | Excel Discussion (Misc queries) | |||
Dynamic Combo Box | Excel Worksheet Functions | |||
connecting combo boxes to yield data in another cell. | Excel Discussion (Misc queries) | |||
dynamic combo boxes | Excel Worksheet Functions |