Control Box - Please help !

G

Guest

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
 
G

Guest

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
 
G

Guest

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
 
G

Guest

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
 

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

Similar Threads

Real-time sorting 11
Blanks Data Validation List 4
control box 1
How do I enter a list in a Combo box? 6
counting 3
Lookup reference help 3
combo box 2
how to apply filter based on list or combo box?? 2

Top