View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Melanie Breden Melanie Breden is offline
external usenet poster
 
Posts: 88
Default Set dropdown programatically

Hi Bura,

I know how to read from a toolbar dropdown

Range("Value") = CommandBars("MyBar").Controls("myDropDown").Text

But suppose I change Range("Value") in some other way (e.g. in a sub) and
want to synchronize the toolbar with the value in the cell. Can I do so
programatically?


use a ComboBox instead a DropDown Control:

With Application.CommandBars.Add("MyBar", Temporary:=True)
With .Controls.Add(msoControlComboBox)
.Caption = "myComboBox"
' ...
' ...


Application.CommandBars("MyBar").Controls("myCombo Box").Text = _
Range("Value").Value

--
Regards

Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)