Ich hoffe das hier ist nicht zu komplex. Habe versucht so viel wie möglich alleine zu machen. Nur komm ich jetzt nicht mehr weiter, weil das meine kenntnisse übersteigt.
Ich habe das alles in Modul1 stehen. Es fehlen nur noch die "Subs" die in der Toolbar aufgerufen werden; stehen aber auch in Modul1, habe sie hier nur nicht hingeschrieben zwecks übersichtlichkeit.
Jetzt bring er mir bei denen den Fehler: "Expected function or variable"
Hat das was mit "option explicit" zu tun. Ich nehm an, dass da irgendwelche objekte zurückgegeben werden. Vielleicht kann man das hier auch viel leichter lösen so dass alle "Subs" bleiben. Es reicht völlig aus ein untermenu in dem menu Administrator zu korrigieren, so dass Ich dann das Format bei den anderen anwenden kann.
Hoffe mal dass mir hier jemand weiterhelfen kann. Ist dann auch mein letztes makro für mein arbeitsblatt und ich nerve euch nicht weiter. ;))
Liebe Grüße
Zergio
Sub Auto_Open()
Call CreateMenubar
End Sub
Sub Auto_Close()
Call RemoveMenubar
End Sub
Sub RemoveMenubar()
On Error Resume Next
ISPToolbar.CommandBars.Delete
On Error GoTo 0
End Sub
Sub CreateMenubar()
Call RemoveMenubar
-------------------------------------------------Hauptmenu
Set ISPToolBar = Application.CommandBars.Add(Name:="Administrator")
ISPToolBar.Right = 200
ISPToolBar.Top = 200
ISPToolBar.Protection = msoBarNoProtection
ISPToolBar.Visible = True
ISPToolBar.Position = msoBarFloating
-------------------------------------------------UnterMenu
Set MenuGoto = ISPToolBar.Controls.Add(Name:="Goto", Type:=msoControlPopup, Before:=1)
-------------------------------------------------UnterMenuMakroButtons
Set oOverview = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=1)
oOverview.OnAction =CommandButtonClose_Click()
oOverview.Caption = "Overview"
oOverview.TooltipText = "Goto overview"
Set oDate = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=2)
oDate.OnAction =CommandButtonDates_Click()
oDate.Caption = "Dates"
oDate.TooltipText = "Goto Date"
Set oEvent = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=3)
oEvent.OnAction =CommandButtonEvent_Click()
oEvent.Caption = "Event"
oEvent.TooltipText = "Goto Event"
Set oDamage = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=4)
oDamage.OnAction =CommandButtonDamage_Click()
oDamage.Caption = "Damage"
oDamage.TooltipText = "Goto Damage"
Set oAnswer = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=5)
oAnswer.OnAction =CommandButtonClosedates_Click()
oAnswer.Caption = "Answer"
oAnswer.TooltipText = "Goto Answer"
-------------------------------------------------
Set MenuSort = ISPToolBar.Controls.Add(Name:="Sort by", Type:=msoControlPopup, Before:=2)
Set SortSN = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=1)
SortSN.OnAction =CommandButtonSortSN_Click()
SortSN.Caption = "Serial Number"
SortSN.TooltipText = "Sort list by Serial Number"
Set SortDate = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=2)
SortDate.OnAction =CommandButtonSortDate_Click()
SortDate.Caption = "Dates"
SortDate.TooltipText = "Sort list by dates damage report complete"
Set MenuCreate = ISPToolBar.Controls.Add(Name:="Create", Type:=msoControlPopup, Before:=3)
Set MkDir = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=1)
MkDir.OnAction =CommandButtonMkDir_Click()
MkDir.Caption = "Directory"
MkDir.TooltipText = "Create Directory of case (row) cell is activate"
Set CopyRow = MenuGoto.Controls.Add(Type:=msoControlButton, Before:=2)
CopyRow.OnAction =CommandButtonCopy_Click()
CopyRow.Caption = "Copy of line"
CopyRow.TooltipText = "Create a copy of activated case (row) and paste in row underneath"
End Sub