Sub Mycell()
Application.CommandBars("Mycell").Delete
With Application.CommandBars.Add("Mycell", msoBarPopup)
With .Controls.Add(Type:=msoControlPopup)
.Caption = "一级菜单"
With .Controls.Add(Type:=msoControlPopup)
.Caption = "二级菜单1"
With .Controls.Add(Type:=msoControlPopup)
.Caption = "三级菜单1"
With .Controls.Add(Type:=msoControlButton)
.Caption = "四级菜单1"
End With
End With
End With
With .Controls.Add(Type:=msoControlButton)
.Caption = "二级菜单2"
End With
End With
End With
End Sub
效果如下