ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Control Box - Please help ! (https://www.excelbanter.com/excel-discussion-misc-queries/49293-control-box-please-help.html)

ynissel

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

Oblik

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


ynissel

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


ynissel

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



All times are GMT +1. The time now is 01:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com