piers_morgan
New Member
- Joined
- Sep 3, 2003
- Messages
- 20
Hi all,
I need both the list and the value of a combobox to update from the macro initiated from another combobox.
So imagine I have a Combobox called "Region". And another combobox called "Countries". Both are defaulted to "All" as the selection until an action is taken.
If a user selects France from Countries combobox, the Region combobox must update with the text "Europe". Or, if the USA was selected, Region box must update with "N.America".
And the texts *do* update just fine appearance-wise. But behind the scenes, in fact the texts of "Europe" are just superficial, and the combobox is stuck on thinking no change happened as a result of the macro. It's actually stuck on "All" (can be determined with a msgbox to see what the value still is).
Here is the key part of the code...
ActiveSheet.Shapes.Range(Array("RegionFormControl")).Select
With Selection
.Text = Sheets("Selections").Range("WYR2").Value ' "WYR2" contains the text "Eurpope" after France was selected. NOW WHY ON EARTH DOES IT NOT ALSO TRULY UPDATE THE VALUE?? ONLY APPEARS TO UPDATE ON THE SCREEN, BUT IS STUCK ON ORIGINAL "ALL" SELECTION
.ListFillRange = "Selections!$a$2:$a$" & LastRowRegion
End With
So I seem to be missing some command like "also update the value for real, not only how the combobox appears on screen".
I am sure I am missing something simple! Thanks guys!
I need both the list and the value of a combobox to update from the macro initiated from another combobox.
So imagine I have a Combobox called "Region". And another combobox called "Countries". Both are defaulted to "All" as the selection until an action is taken.
If a user selects France from Countries combobox, the Region combobox must update with the text "Europe". Or, if the USA was selected, Region box must update with "N.America".
And the texts *do* update just fine appearance-wise. But behind the scenes, in fact the texts of "Europe" are just superficial, and the combobox is stuck on thinking no change happened as a result of the macro. It's actually stuck on "All" (can be determined with a msgbox to see what the value still is).
Here is the key part of the code...
ActiveSheet.Shapes.Range(Array("RegionFormControl")).Select
With Selection
.Text = Sheets("Selections").Range("WYR2").Value ' "WYR2" contains the text "Eurpope" after France was selected. NOW WHY ON EARTH DOES IT NOT ALSO TRULY UPDATE THE VALUE?? ONLY APPEARS TO UPDATE ON THE SCREEN, BUT IS STUCK ON ORIGINAL "ALL" SELECTION
.ListFillRange = "Selections!$a$2:$a$" & LastRowRegion
End With
So I seem to be missing some command like "also update the value for real, not only how the combobox appears on screen".
I am sure I am missing something simple! Thanks guys!