Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Bura Tino wrote: Application.CommandBars("MyBar").Controls("myCombo Box").Text = _ Range("Value").Value Hmmm. I still get "Invalid procedure call or argument". in which line stops the debugger? Here is the complete Code, (tested from XL97 to XL2003 with Win XP): Sub DropDownBar() On Error Resume Next Application.CommandBars("MyBar").Delete On Error GoTo 0 With Application.CommandBars.Add("MyBar", Temporary:=True) With .Controls.Add(msoControlComboBox) .Caption = "myComboBox" .AddItem "A" .AddItem "B" .AddItem "C" .OnAction = "ComboValue" End With .Visible = True End With End Sub Sub ComboValue() Range("Value") = CommandBars("MyBar").Controls("myComboBox").Text End Sub Sub SetDropDownValue() Application.CommandBars("MyBar").Controls("myCombo Box").Text = _ Range("Value").Value End Sub (What's the difference between a drop down and a combo box?) It´s impossible to show an entry/value in a dropdown control with using VBA. You have to use a comboBox. -- Regards Melanie Breden - Microsoft MVP für Excel - http://excel.codebooks.de (Das Excel-VBA Codebook) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dropdown box display only data dependent on another dropdown box? | Excel Worksheet Functions | |||
How to programatically control a 3D-sum? | Excel Worksheet Functions | |||
offer dropdown options based on another dropdown | Excel Discussion (Misc queries) | |||
Programatically set ref to my DLL | Excel Programming | |||
Altering UI Programatically | Excel Programming |