Excel - Combo box location

F

Fherrera

Hi, is it only possible to add a combo box to a user form? If i create
a generic function i'd like to be accessible to me anytime (like th
sum function int he toolbar but different) what would be the best wa
fo doing it (ie. a button i click but a button that's always visible).

A simple button can be made into a user created toolbar, but if thi
function of mine has certain options and I'd like to show those option
in a combo box (Well only one option :) and have a command butto
beside that... (I guess that would be a combo box with a list and
command button) can I put these two in a toolbar? Furthermore, can
add custom buttons to an already existing toolbar..like the standar
toolbar...?

Thanks.

Fran
 
B

BrianB

Right click an existing toolbar and select Customize from the dropdow
menu.
*Any* button in Commands can then be dragged to *any* toolbar.
Right click *any* button on the toolbar to get another dropdown whic
includes several options, one of which is to assign a macro
 
B

BrianB

PS I seem to remember that it is possible to add a combobox to a toolba
- but not in Excel 97 which I am using at present
 
F

Fherrera

Actually it is possible, except you have to do it in VBA. When I sa
combo box here it is simply a list box that does something once a lis
item is picked, one where you can populate the list yourself.

In excel help look for:

"Adding and modifying toolbars"

and the second half talks about combo box's

Here's the example they give:

The following example adds a combo box with the label "Quarter" to
custom toolbar and assigns the macro named "ScrollToQuarter" to th
control.

Set newCombo = CommandBars("Custom1").Controls _
.Add(Type:=msoControlComboBox)
With newCombo
.AddItem "Q1"
.AddItem "Q2"
.AddItem "Q3"
.AddItem "Q4"
.Style = msoComboNormal
.OnAction = "ScrollToQuarter"
End Wit
 
Top