2016-12-07 4 views
0

Ich habe ein Makro zum Excel-Zellen-Kontextmenü hinzugefügt.Excel-Zellen-Kontextmenü - Makro

Dies ist der Hauptcode,

Private Sub Workbook_Open() 
Dim NewControl As CommandBarControl 
    Application.CommandBars("Cell").Reset 
    Set NewControl = Application.CommandBars("Cell").Controls.Add 
    With NewControl 
     .Caption = "Inserir Data" 
     .OnAction = "Module1.OpenCalendario" 
     .BeginGroup = True 
    End With 
End Sub 

Hier können Sie sehen das Ergebnis,

Excel Cell Context Menu

Ih es trotzdem auf dem oberen Rand des Menüs dieses Makro zu setzen?

Antwort

0

Versuchen:.

Set NewControl = Application.CommandBars("Cell").Controls.Add(before:=1) 
+0

nicht, dass Art und Weise arbeiten, aber ich habe versucht, Add (,,, 1) und es funktioniert endlich. Danke für die Hilfe. – nioxys