Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi guys,
pretty new to the programming of excel and would like to ask bout this question. Here's what i have done so far: i have a two comboboxes (i.e. ComboBox A and B) say i have a few values in ComboBoxA and when a user selects a certain value, ComboBoxB would change it's ListFillRange according to the value selected in ComboBoxA. However, the values in ComboBoxB would not update itself unless i manually change the values in ComboBoxB. anyone can help me in terms of how to refresh the ListFillRange in ComboBoxB when a selection in ComboBoxA is changed? my code: Private Sub ComboBox2_Change() If ComboBox1.Value = "A" Then ComboBox2.ListFillRange = "AList" Else ComboBox2.ListFillRange = "BList" End If End Sub Thanks in Advance, Melvin |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Melvin
As you change the value of ComboBox A, you need to use the event code for ComboBox 1 not ComboBox 2. Private Sub ComboBox1_Change() If ComboBox1.Value = "A" Then ComboBox2.ListFillRange = "AList" Else ComboBox2.ListFillRange = "BList" End If me.Repaint End Sub Regards, Per "mEl" skrev i meddelelsen ... hi guys, pretty new to the programming of excel and would like to ask bout this question. Here's what i have done so far: i have a two comboboxes (i.e. ComboBox A and B) say i have a few values in ComboBoxA and when a user selects a certain value, ComboBoxB would change it's ListFillRange according to the value selected in ComboBoxA. However, the values in ComboBoxB would not update itself unless i manually change the values in ComboBoxB. anyone can help me in terms of how to refresh the ListFillRange in ComboBoxB when a selection in ComboBoxA is changed? my code: Private Sub ComboBox2_Change() If ComboBox1.Value = "A" Then ComboBox2.ListFillRange = "AList" Else ComboBox2.ListFillRange = "BList" End If End Sub Thanks in Advance, Melvin |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey thanks buddy!
it worked! Melvin "Per Jessen" wrote: Hello Melvin As you change the value of ComboBox A, you need to use the event code for ComboBox 1 not ComboBox 2. Private Sub ComboBox1_Change() If ComboBox1.Value = "A" Then ComboBox2.ListFillRange = "AList" Else ComboBox2.ListFillRange = "BList" End If me.Repaint End Sub Regards, Per "mEl" skrev i meddelelsen ... hi guys, pretty new to the programming of excel and would like to ask bout this question. Here's what i have done so far: i have a two comboboxes (i.e. ComboBox A and B) say i have a few values in ComboBoxA and when a user selects a certain value, ComboBoxB would change it's ListFillRange according to the value selected in ComboBoxA. However, the values in ComboBoxB would not update itself unless i manually change the values in ComboBoxB. anyone can help me in terms of how to refresh the ListFillRange in ComboBoxB when a selection in ComboBoxA is changed? my code: Private Sub ComboBox2_Change() If ComboBox1.Value = "A" Then ComboBox2.ListFillRange = "AList" Else ComboBox2.ListFillRange = "BList" End If End Sub Thanks in Advance, Melvin |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create refresh button in worksheet to refresh Pivot Table Data | Excel Worksheet Functions | |||
Timing of automatic query refresh and macro pivot table refresh | Excel Programming | |||
auto refresh for combobox | Excel Programming | |||
Refresh combobox after inserting new sheet | Excel Programming | |||
Pivot Table REFRESH Flaw -- Saves Old Data in Selection Area AFTER REFRESH | Excel Programming |