If you include the macros in your personal workbook they will be available at all times. If you click Window, Unhide you should see the Personal workbook. If not, record a macro and select the destination to be Personal Macro Workbook.
This file is loaded automatically every time you open Excel so you could assign a button or menu option to the macros.
HTH,
Dax.
Hi Rayan
If you place the code below in the Workbook module of your personal workbook, it will add two command bar buttons automatically. Just change the Text and Onaction (your macro names) to suit.
Dim Cbar As CommandBarPopup
Dim cBut1 As CommandBarButton
Dim cBut2 As CommandBarButton
Private Sub Workbook_BeforeClose(Cancel As Boolean)
If Cancel = True Then Exit Sub
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("&OzGrid").Delete
End Sub
Private Sub Workbook_Open()
On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("&OzGrid").Delete
Set Cbar = Application.CommandBars("Worksheet Menu Bar").Controls.Add(Type:=msoControlPopup)
Cbar.Caption = "&OzGrid"
Set cBut1 = Cbar.Controls.Add(Type:=msoControlButton)
With cBut1
.Caption = "My Macro1"
.Style = msoButtonCaption
.OnAction = "MyMacro1"
.FaceId = 26
End With
Set cBut2 = Cbar.Controls.Add(Type:=msoControlButton)
With cBut2
.Caption = "My Macro2"
.Style = msoButtonCaption
.OnAction = "MyMacro2"
End With
End Sub
Dave
OzGrid Business Applications