Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox on custom toolbar?
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'm thinking it needs to be done through code as I cannot bring up the properties window to assigned a source range or linked cell as one would do if placing on a form. Any thoughts??? Thanks!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Listbox on custom toolbar?
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox on custom toolbar?
Larry Adams wrote:
I need to understand the coding conventions to (a) identify and (b) work with an existing combobox control on an existing toolbar. With Application.CommandBars("MyToolbar") With .Controls("MyComboBox") ' the name is the caption that pops up MsgBox .Value & " is selected" & vbCrLf & "It is entry " & .ListIndex+1 End With End With If that doesn't cover what you wanted, please give more details. Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox on custom toolbar?
Okay, this gave me enough clues and I have some test code running okay. By
"work with an existing combo box control", I was mostly looking for a good summary of what properties and methods apply specifically to toolbars and toolbar controls. The help system has this information, more or less, but I have been hoping to find a comprehensive example showing what all one can do in working with toolbar controls. But I have a working start -- which is much better than before. Thanks much. Larry. Bill Manville wrote: Larry Adams wrote: I need to understand the coding conventions to (a) identify and (b) work with an existing combobox control on an existing toolbar. With Application.CommandBars("MyToolbar") With .Controls("MyComboBox") ' the name is the caption that pops up MsgBox .Value & " is selected" & vbCrLf & "It is entry " & .ListIndex+1 End With End With If that doesn't cover what you wanted, please give more details. Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combobox on custom toolbar?
Larry Adams wrote:
By "work with an existing combo box control", I was mostly looking for a good summary of what properties and methods apply specifically to toolbars and toolbar controls. Look in the object browser for CommandBarComboBox Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
custom toolbar | Excel Discussion (Misc queries) | |||
VBA custom toolbar | Excel Discussion (Misc queries) | |||
Custom Toolbar | Excel Discussion (Misc queries) | |||
listbox.value not equal to listbox.list(listbox.listindex,0) | Excel Programming | |||
saving toolbar buttons on custom toolbar | Excel Programming |