View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Larry Adams Larry Adams is offline
external usenet poster
 
Posts: 12
Default Combobox on custom toolbar?

Bill, I very much appreciate the example, but now I need to understand the
coding conventions to (a) identify and (b) work with an existing combobox
control on an existing toolbar. Any suggestions? Thanks!

Bill Manville wrote:

Larry Adams wrote:
Excel allows one to drag a listbox, combo box, etc. to a custom toolbar,
and will label it to match -- but I cannot find any references as to how
to populate.


I am not aware that you can put a listbox on a toolbar, but certainly you
can create a commbobox or dropdown by using code

Sub test()
With Application.CommandBars.Add("MyBar", temporary:=True)
.Visible = True
With .Controls.Add(msoControlDropdown)
.Caption = "MyBox"
.AddItem "A"
.AddItem "B"
.AddItem "C"
End With
End With
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup