I have the code below which I use to create a custom menu that runs on workbook opening and is removed on workbook closing. this works fine but I would like to have some items (such as expand and collapse below) as single button that will activate the relevent subroutine. I have tried what I thought to be the obvious solution of simply creating custom buttons and assigning a macro to them. This works fine but they appear on all workbooks I open which I don't want so I went down the road of adapting the custom menu code below. The menu 'mytag' works fine, so I added 'mytag2' and 'mytag3'. (at the bottom of the code)
The menu's build and remove on workbook opening and closing and on the first click of the mouse on either expand or collapse it initiates the macro correctly. However after the first click the macros are run as soon as the mouse runs over the menu rather than when it is clicked.
Can you suggest a solution to this or possibly a better option of building custom buttons on workbook open and removing them on close
![]()
Please Login or Register to view this content.
Bookmarks