Maybe a quick study of this code will help you. Run it to see how it works...<pre>
Sub AddControls()
Dim cBarParentBar As CommandBar
Dim cBarParentBarPopUp As CommandBarPopup
Dim cBarParentBarPopUpControls(1 To 5) As CommandBarButton
Dim intArrayCounter As Integer
Set cBarParentBar = Application.CommandBars( _
"Worksheet Menu Bar")
On Error Resume Next
cBarParentBar.Controls("Popup Control").Delete
On Error GoTo 0
Set cBarParentBarPopUp = cBarParentBar.Controls.Add( _
msoControlPopup, , , , True)
With cBarParentBarPopUp
.Caption = "Popup Control"
.Visible = True
End With
For intArrayCounter = 1 To 5
Set cBarParentBarPopUpControls(intArrayCounter) = cBarParentBarPopUp.Controls.Add( _
msoControlButton, , , , True)
With cBarParentBarPopUpControls(intArrayCounter)
.Caption = "Add button # " & intArrayCounter
.Style = msoButtonCaption
.Visible = True
.OnAction = "CommandBarButton_Click"
.Tag = intArrayCounter
End With
Next
Erase cBarParentBarPopUpControls
Set cBarParentBarPopUp = Nothing
Set cBarParentBar = Nothing
End Sub
Sub CommandBarButton_Click()
Select Case Application.CommandBars.ActionControl.Tag
Case 1
MsgBox "Run code for button 1"
Case 2
MsgBox "Run code for button 2"
Case 3
MsgBox "Run code for button 3"
Case 4
MsgBox "Run code for button 4"
Case 5
MsgBox "Run code for button 5"
End Select
End Sub</pre>
Tom