option button in toolbar

P

peljo

Can somebody help me build an option button in a toolbar ? I mean a button
with dropped down 2 possibilities needed to build a code.I can build a single
button with the code shown below.i will be grateful if someone could help me
built an option button with the same code.

Sub ToolbarCustomers()

Dim cbr As Object
Dim cbb As Object
' msoBarTop = 1
Set cbr = CommandBars.Add(Name:="MyToolbarCustomers", Position:=1,
Temporary:=True)


1. msoControlButton = 1 First buton MyBack2
Set cbb = cbr.Controls.Add(Type:=1, Temporary:=True)
With cbb
'.Caption = "My Button"
' msoButtonCaption = 2
' .Style = 2
.FaceId = 41
.Width = 60
.FontWeight = 800


.OnAction = "MyBack2"
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top