Macro Button

B

blueglass74

I dragged a macro button onto the toolbar in my workbook. I just wante
to use this macro in one workbook. When I opend up a new work book, th
macro button was in that document as well? How do I get a macro butto
on the tool bar to only appear in a specific workbook
 
G

Greg Koppel

You need to assign/unassign the macros to the buttons when the workbook is
opened.

Sub Auto_open()
Toolbars("LogForm").Visible = True
Toolbars("LogForm").ToolbarButtons(1).OnAction = "PhoneLogger"
Toolbars("LogForm").ToolbarButtons(2).OnAction = "LateLogger"
End Sub
Sub Auto_close()
On Error Resume Next
Toolbars("LogForm").ToolbarButtons(1).OnAction = ""
Toolbars("LogForm").ToolbarButtons(2).OnAction = ""
Toolbars("LogForm").Visible = False

Toolbars("LogForm").Delete
On Error GoTo 0
End Sub

HTH, Greg
 
Top