Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DJ DJ is offline
external usenet poster
 
Posts: 13
Default shortcutmenu

I've created my own 'rightclick' menu that I have made pop-
up when I rightClick a cell. I've got the code working
but the How do I temporarily 'disappear' the shortcut menu
that regularly appears when I rightclick a cell. What's
the name of the menu (and ID...just in case I need to
restore it :| Also- is there a handy dandy ID list for
commandbars?

thanks in advance,
dj
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default shortcutmenu

DJ,

Add this code to the sheet module where you want this custom right-click
menu.

Public fCustomCell As Boolean

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If fCustomCell Then
Cancel = True 'Supress builtin Cell menu
CommandBars("newCell").ShowPopup 'Show custom version
End If
End Sub

To make your menu the new right-click menu, set the variable fCustomCell,
like so

Sheet1.fCustomCell = True

To go back to normal, unset it, like so

Sheet1.fCustomCell = False


If you want it to apply to all sheets, use this event in the ThisWorkbook
vco0de module, with the same variable and same event code

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target
As Range, Cancel As Boolean)

End Sub

In this instance, refer to the variab le like so

ThisWorkbook.fCustom Cell = True (or False)


This code will list all commandbars in a spare worksheet

Dim cb As CommandBar
Dim i As Long

i = 1
With Worksheets(3)
For Each cb In CommandBars
Cells(i, 1).Value = cb.Name
i = i + 1
Next cb
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"dj" wrote in message
...
I've created my own 'rightclick' menu that I have made pop-
up when I rightClick a cell. I've got the code working
but the How do I temporarily 'disappear' the shortcut menu
that regularly appears when I rightclick a cell. What's
the name of the menu (and ID...just in case I need to
restore it :| Also- is there a handy dandy ID list for
commandbars?

thanks in advance,
dj



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"