View Full Version : Add Control To Right-Click Cell Context Menu
Excel Fox
Down loaded your calendar - thanks - how did you add the Calendar choice when you right_click on a cell _ I posted that question on MrExcel - never got any answers - can you show that piece of code?
Thanks
Excel Fox
04-17-2011, 07:07 AM
Here's the code Rasm
Private Sub AddOnRightClick()
On Error Resume Next
Dim cbrButton As CommandBarButton
With Application
.CommandBars("Cell").Controls("Calendar").Delete
Set cbrButton = .CommandBars("Cell").Controls.Add(Temporary:=True, Before:=1)
End With
With cbrButton
.BeginGroup = True
.Style = msoButtonIconAndCaption
.Caption = "Calendar"
.FaceId = 125
.OnAction = "ShowCalendar"
End With
Set cbrButton = Nothing
On Error GoTo 0
End Sub
Private Sub DeleteOnRightClick()
On Error Resume Next
With Application
.CommandBars("Cell").Controls("Calendar").Delete
End With
On Error GoTo 0
End Sub
Cool - this works nicely - sweet.
Here is a link to a bunch of different .FaceId values.
http://www.outlookexchange.com/articles/toddwalker/BuiltInOLKIcons.asp
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.