Hallo,
ich lasse mir eine neue Commandbar mit Namen von MA erstellen.
Wenn ich dann auf den Button von dem MA klicke, soll der Name ausgegeben werden.
Wie bekomme ich das hin?
Public i As Integer, Reihe As Integer
Private Sub MA_Namen_1()
Dim cmdBar As CommandBar
Set cmdBar = Application.CommandBars.Add("MA_Namen_1", msoBarTop, Temporary:=True)
Reihe = 1
MA = Cells(Reihe, 1).Value
With cmdBar
.Name = "MA_Namen_1"
.RowIndex = 2
.Position = msoBarTop
.Visible = True
For i = 1 To 36
With .Controls.Add(Type:=msoControlButton, Temporary:=True)
.Style = msoButtonIconAndCaption
.Caption = MA
.OnAction = "NamenAusgeben"
End With
Reihe = Reihe + 1
MA = Cells(Reihe, 1).Value
Next i
End With
End Sub