ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Context menu of Cell (https://www.excelbanter.com/excel-programming/355086-context-menu-cell.html)

MadDog

Context menu of Cell
 
Is there any way that I can change the context menu of a cell in Excel
?

Thanks for all your help.


RB Smissaert

Context menu of Cell
 
Yes, quite simple:

With Application.CommandBars("Cell")

With .Controls.Add(Type:=msoControlButton)
.BeginGroup = True
.Caption = "Change text to numbers in selected sheet range"
.OnAction = "MakeNumbers"
.FaceId = 399
End With

etc.


RBS


"MadDog" wrote in message
oups.com...
Is there any way that I can change the context menu of a cell in Excel
?

Thanks for all your help.



Bob Phillips[_6_]

Context menu of Cell
 
Dim oCtl As CommandBarControl

With Application.CommandBars("Cell")

On Error Resume Next
.Controls(20).Delete
On Error GoTo 0

With .Controls.Add(Type:=msoControlButton)
.BeginGroup = True
.Caption = "My Button"
.Style = msoButtonCaption
.OnAction = "myMacro"
End With

End With


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"MadDog" wrote in message
oups.com...
Is there any way that I can change the context menu of a cell in Excel
?

Thanks for all your help.





All times are GMT +1. The time now is 06:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com