#1   Report Post  
Posted to microsoft.public.excel.misc
ynissel
 
Posts: n/a
Default combo box

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   Report Post  
Posted to microsoft.public.excel.misc
Elkar
 
Posts: n/a
Default combo box

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   Report Post  
Posted to microsoft.public.excel.misc
ynissel
 
Posts: n/a
Default combo box

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo Box David French Excel Worksheet Functions 0 October 3rd 05 06:02 PM
Nesting Combo Boxes /Returning an Array ELMONDO SNITHER Excel Discussion (Misc queries) 1 June 30th 05 01:15 AM
Dynamic Combo Box benjarfer Excel Worksheet Functions 2 April 8th 05 02:17 PM
connecting combo boxes to yield data in another cell. TxN8tv Excel Discussion (Misc queries) 0 March 14th 05 04:07 PM
dynamic combo boxes tjb Excel Worksheet Functions 2 January 25th 05 07:33 PM


All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"