I have compiled a set of macros and user forms (lets call them extras) and I have managed to place them in the context menu of the cell.
I have used the logic described in this article. Check the code of AddToCellMenu and DeleteFromCellMenu Subs.
It worked on one or more cells perfectly, however I realized that when I right clicked a row or column the context menu did not have the extras.
It applied on one or more cells cause I have used
but in order to make it work for rows context menu I have to useCode:Dim ContextMenu As CommandBar Set ContextMenu = Application.CommandBars("Cell")
and for columns context menu useCode:Dim ContextMenu As CommandBar Set ContextMenu = Application.CommandBars("Rows")
I would like to combine them somehow so as not to repeat unnecessarily lines of code for each context menu so as to apply the extras, especially if you think that they are in several submenus also...Code:Dim ContextMenu As CommandBar Set ContextMenu = Application.CommandBars("Columns")
Please advise... and thank you in advance for any idea.




Reply With Quote
Bookmarks