Drop Down Menu on tool bar
Hi Alan,
Ok, from what I can understand of what I've done, yours is the one that I'm
looking for.
Now for some questions.
When you say copy the first paragraph for just the drop down, please
highlight that, so I'm not misreading it, adding too little, or too much--
I'm notorious for doing something stupid, and spending hours afterwards to
figure out why.
The same for a new button-- although, using the "customize menu" option
seems to be working just as easily-- I'd still like to understand what's
happening.
Where can I read more on this specific topic? Details.....
I'll be making about 7 or 8 of these (for me) drop downs for excel at work,
and need to understand it for both explaining to others, and repeatability.
Again, thank you for your help.
Greg, yours is just a bit too far beyond my comprehension. I did tinker with
it, but didn't seem to get what's going on. And none of the changes that I
made appeared as anticipated. Although, I'll be the first to admit that I
just plain have no clue of what I'm doing, and am trying to figure it out as
I go. Arrays I get, but my limits extend to 1 semester of C++ at school, and
I only got a C in that.
Thank you.
"Alan" wrote:
Option Explicit
Sub CreatePopupToolbar()
Dim TBar As CommandBar
Dim btnNew As CommandBarButton
Dim btnPop As CommandBarPopup
' Add a new Toolbar
Set TBar = CommandBars.Add(Name:="Toolbar Name")
TBar.Visible = True
' Add a dropdown button
Set btnPop = TBar.Controls.Add(Type:=msoControlPopup)
btnPop.Caption = "Dropdown Button Caption"
' Add standard buttons to the "Dropdown Button"
Set btnNew = btnPop.Controls.Add(Type:=msoControlButton)
btnNew.Style = msoButtonIconAndCaption
btnNew.Caption = "Caption"
btnNew.FaceId = 84 ' This is E but can be changed or removed.
btnNew.OnAction = "MacroName"
Set TBar = Nothing
Set btnPop = Nothing
Set btnNew = Nothing
End Sub
Copy the last two paragraphs to create a new dropdown list, copy only the
last paragraph to create another button within a dropdown. (Changing names
of course.)
Alan
"SteveDB1" wrote in message
...
Hi all.
I have been making a series of "autofill" type macros in excel with
buttons
in my tool bar.
While they're working great, today it dawned on me that I should be able
to
have fewer items if I were to have a drop down menu as one of my tool
bars.
This would allow me to have autofill names in the drop down, instead of
having to have 25 or so buttons across the top of my worksheet on top of
all
the other single click icon/buttons.
I have found, and see where I can place drop downs within the worksheet
itself, but haven't yet figured out how to get it to work for the tool bar
up
top.
1- is it possible to have a drop down menu on the excel tool bar? Not in
the
worksheet....
If so, how do I make it?
If I'm in the wrong place, please move this post over to the right spot,
and
let me know.
Thanks.
|