Softlinksys
New Member
- Joined
- Jan 23, 2021
- Messages
- 2
- Office Version
- 2016
- Platform
- Windows
I have written some code that adds 2 new entries to the Cell right mouse click context menu. This works fine. However, I have found a spreadsheet where the menu references for the right mouse click on a cell appear to be messed up. I have added some code (courtesy of Ron de Bruin's website) that adds a button onto each CommandBar that shows its name and index value. So, on most Worksheets if you right mouse click in a Cell you see the added button that says "Cell 39". It is the CommandBar called Cell and it has Index 39. I have one workbook in which if you do this you get a Commandbar called Query with and Index of 63. If I Right click on the corner selecting the whole sheet I get the Cell 39 toolbar (which I think is correct). If I open a new sheet in the same Workbook, everything is correct... the cell context menu is Cell, the corner context menu is also Cell. Clearly, the right mouse click on a cell in Sheet1 is giving me the wrong toolbar. I need a way to fix this in VBA, so any spreadsheet I open will have the right menu associated with the right mouse click on a cell, otherwise my 2 extra buttons won't show! I will be very grateful if anybody can help me with this. By the way, I am using a Personal.xlsb file with an Auto_open routine so the code will always run at start-up.