Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Control Box - Please help !
I have a combo box whose list fill range is linked to a specific range. My
issue is -that based on some other criteria - the list should be 5 or 10 numbers. How can I get the combobox to understand that this should be dynamic to the other variable ? ie - if program = A then the drop down list should be 1,2,3,4,5 {actually cells a1..a5} else the list should be 1,2,3,4,5,6,7,8,9,10 {cells a1..a10}? Thanks, yosef |
#2
|
|||
|
|||
Hi ynissel
Private Sub ComboBox1_GotFocus() If Range("d1").Value = "a" Then ComboBox1.ListFillRange = "a1:a5" Else: ComboBox1.ListFillRange = "a1:a10" End If End Sub pls take note of the first line - its about _gotfocus, and not _click "ynissel" wrote: I have a combo box whose list fill range is linked to a specific range. My issue is -that based on some other criteria - the list should be 5 or 10 numbers. How can I get the combobox to understand that this should be dynamic to the other variable ? ie - if program = A then the drop down list should be 1,2,3,4,5 {actually cells a1..a5} else the list should be 1,2,3,4,5,6,7,8,9,10 {cells a1..a10}? Thanks, yosef |
#3
|
|||
|
|||
Thanks.
This is what I currently have in there Private Sub ComboBox3_Change() ComboBox3.Value = Format(ComboBox3.Value, "0.000%") End Sub Since Im not a programmer - where would I copy your text into ? Thanks agian. Yosef "Oblik" wrote: Hi ynissel Private Sub ComboBox1_GotFocus() If Range("d1").Value = "a" Then ComboBox1.ListFillRange = "a1:a5" Else: ComboBox1.ListFillRange = "a1:a10" End If End Sub pls take note of the first line - its about _gotfocus, and not _click "ynissel" wrote: I have a combo box whose list fill range is linked to a specific range. My issue is -that based on some other criteria - the list should be 5 or 10 numbers. How can I get the combobox to understand that this should be dynamic to the other variable ? ie - if program = A then the drop down list should be 1,2,3,4,5 {actually cells a1..a5} else the list should be 1,2,3,4,5,6,7,8,9,10 {cells a1..a10}? Thanks, yosef |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Control Box - Please help !
I sent this out as a sperate message but realized I should have replied here.
I added a second if statement and its not working can you troubleshppt for me ? Thanks, Yosef Private Sub ComboBox1_GotFocus() If Range("d1").Value = "a" Then ComboBox1.ListFillRange = "a1:a5" If Range("d1").Value = "b" Then ComboBox1.ListFillRange = "a1:a15" Else: ComboBox1.ListFillRange = "a1:a10" End If End If End Sub Thanks, Yosef "Oblik" wrote: Hi ynissel Private Sub ComboBox1_GotFocus() If Range("d1").Value = "a" Then ComboBox1.ListFillRange = "a1:a5" Else: ComboBox1.ListFillRange = "a1:a10" End If End Sub pls take note of the first line - its about _gotfocus, and not _click "ynissel" wrote: I have a combo box whose list fill range is linked to a specific range. My issue is -that based on some other criteria - the list should be 5 or 10 numbers. How can I get the combobox to understand that this should be dynamic to the other variable ? ie - if program = A then the drop down list should be 1,2,3,4,5 {actually cells a1..a5} else the list should be 1,2,3,4,5,6,7,8,9,10 {cells a1..a10}? Thanks, yosef |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to insert date using a pop up calendar control in a cell i | Excel Discussion (Misc queries) | |||
API for MS Chart Control | Charts and Charting in Excel | |||
Tab to an ActiveX control? | Excel Discussion (Misc queries) | |||
Variable control tip text | Excel Discussion (Misc queries) | |||
Copying list-box control | Excel Discussion (Misc queries) |