Modify Right-Click Menu Built-in Commands

Apr 17, 2008

I am developing a program for my electrical calculations (electrical panel). In the program, on my worksheet, I need all row inserts/deletes being watched and logged into another worksheet. I have become to a conclusion it would be best done by "taking over" default behaviour of built-in right-click menu commands like "Copy", "Paste" and "Delete".

In the ozgrid tips page I found some solutions how to deactivate those commands, but that is not what is best for me - when the menu item (or a corresponding key) is pressed, I would like to check if the ActiveCell (or ActiveRow) meats some criteria, and acording to that, make some changes in my "log" - and after - let further actions to default command behaviour. I think of it like "BeforeDelete", "BeforeInsert" or something. In fact the "log" is the worksheet with coordinates of my tables from the first worksheet, which should be changed according to new size of a table after the row insert or delete.

View 3 Replies


ADVERTISEMENT

Missing Menu Commands

Oct 29, 2008

I have run into a problem with the Insert menu.

In the submenu
Cells
Rows
Columns
Worksheet

are "Greyed out" and therefore not available.

This happens when the application is first opened - no code is running it seems to be associated with the Personal workbook?

I have not encountered this previously.

IT help desk was its usual high standard - ZIP

I have searched this board without success.

The Microsoft Help functions were also silent.

View 9 Replies View Related

Disable Menu Commands

Jun 1, 2007

I need to disable the "save as" file menu command when a user opens a shared document. Upon exit I want to enable the save as so that other opened worksheets are not affected. This code works: CommandBars("File").Controls("Save As...").Enabled = False

My problem is this. I can activate this command by selecting run in the VB editor.
But I need for this action to be automatic when a user opens the worksheet. I did this in the editor:

Under general

Sub dISABLESAVEAS()
CommandBars("File").Controls("Save As...").Enabled = False
End

Sub WORKSHEET_BEFORECLOSE()
CommandBars("File").Controls("Save As...").Enabled = True
End

View 2 Replies View Related

To Access Non-native Menu Commands In VBA

Jan 2, 2009

I have not been able to find any references to anywhere, so here I am....

I'm using Excel 2003 that has a menu bar added by another program that interfaces with it (via DDE, as I understand it). The DLL's from the other program have no documentation and/or ability for me to connect to the particular drop-down menu command I'm using. It is a refresh command that re-imports stock market trade data because DDE drops trade messages.

View 11 Replies View Related

Macro To Right Click A Cell And Select Item From Right Click Menu?

Feb 7, 2014

I wonder if it is possible to make a macro that right clicks a cell and then chooses a option from the list?

View 11 Replies View Related

Modify The Menu Bar

Mar 19, 2009

I have some code that loads and unloads a command under the "DATA" menu bar. Is it possible to add an item to the menu bar and put the commands under the new menu item? For example: Add "XYZ Consulting" as a menu bar item so it would like as follows: File, Edit, Insert, Format, Tools, Data, Window, XYZ Consulting.

View 5 Replies View Related

Modify Context Menu For Chart?

Apr 19, 2013

Is it possible to modify the context menu for a chart? I want to create a menu option that runs a macro. I've found code that modifies the context menu for cells, but I haven't had any luck with charts.

View 2 Replies View Related

Right Click Sheet Menu

Sep 14, 2007

Need code to allow the sheets in a workbook to be selected from the right click menu

View 11 Replies View Related

Replace Right-Click Menu

Jul 29, 2009

I want to be able to give my application menu when the user right-clicks on a specific series of cells. I've already got the code that will limit the right-click options to the cells that I want.

How do I then form and execute the menu that I want the user to see - "Archive Data", "Edit Data", "Add Data", for instance, rather than the normal right-click menu?

View 2 Replies View Related

Right Click Menu Modification

Mar 21, 2007

I have been modifying the options available on my right click menu, getting rid of about half of what was there and adding items I use quite often like Paste Values, Paste Formats, Paste Formulas, Sort..., AutoSum, and Format as Percent, as well as adding group dividers. I have it just the way I want it, but I have one issue. If the clipboard is empty, all of the paste buttons are disabled on the Standard toolbar and in the Edit menu as are the Paste and Paste Special... items on the right click menu, but the new paste items I added to my right click menu are still enabled. If I click on one, I get a "PasteSpecial method of Range class failed" error because I have no range selected. I got around this by adding On Error Resume Next to the macros of my added paste functions - not elegant, but functional. Is there a way to have those items appear grayed out and disabled on my right click menu when the clipboard is empty as opposed to my current workaround?

View 9 Replies View Related

Disable Right Click Pop Up Menu

Aug 26, 2007

Question regarding the disabling of right mouse button click options and have used the code below to disable and reciprocal code to enable options. The code works well in Excel 2003 but have recently used the spreadsheet in excel 2000 and the code causes a runtime error 5 'Invalid procedure call or argument'. how to amend the code to have it also work with Excel 2000.

With Application. CommandBars(" Cell")
.Controls("Cut").Visible = False
.Controls("Paste Special...").Visible = False
.Controls("Insert...").Visible = False
.Controls("Delete...").Visible = False
.Controls("Clear Contents").Visible = False
.Controls("Insert Comment").Visible = False
.Controls("Format Cells...").Visible = False
.Controls("Pick from drop-down list...").Visible = False
.Controls("Format Cells...").Visible = False
.Controls("Add Watch").Visible = False
.Controls("Create List...").Visible = False
.Controls("Hyperlink...").Visible = False
.Controls("Look up...").Visible = False
End With

View 3 Replies View Related

MsoControlPopup To Right Click Menu

Jan 18, 2008

I have acquired code to add an item to the right-click menu.

I have added my item using "before:=1", which works fine by putting the item at the top of the list of items in the menu.

My problem is that I require to add the same item ( obviously with a different name ) that needs to be at the bottom of the list.

The reason being, that the pop-up can either display downwards or upwards and I want the user to be in closest proximity of the item.

if it possible ) to add an item to the bottom of the list.

The line I need to change is:

CommandBars("Cell").Controls.Add(Type:=msoControlPopup, before:=1).Caption = "MyMacros2"

View 3 Replies View Related

Right-Click Menu With Multiple Textboxes

Dec 10, 2009

I created a right-click menu for userform textboxes from a code I found through googling. It works perfect, however, I don't know how to get it to work for more than one textbox.

Here's the code for the userform:

View 10 Replies View Related

Right Click Custom Menu Repeats Itself

Dec 26, 2010

I made custom menu with these instructions: [URL]....

Problem is that when I right click my makro keeps copying itself. Ten times right click=ten my macro in the right click menu. It means that

Private Sub Workbook_Deactivate() doesn't work as it should be?

View 2 Replies View Related

Popup Menu On Double Click

Jul 11, 2014

Is it possible to create a menu that could be called by a double click which would allow you to click on a value from that menu and insert it into the double clicked cell. I know I could use a data validation list, but that is tacky and you have to scroll down the list to find the data you would like. I'd like to have a menu pop up that stores different values in 6 columns and 25 rows. Any way without having to jump into an access database?

View 2 Replies View Related

Right Click Forms Button Menu

Apr 15, 2007

I must have disabled right click on the forms button. I usually associate a macro with the button but the menu disapeared. How can I get it back.

View 9 Replies View Related

With Right Click Menu Comandbar Popup

May 5, 2007

I've run into this really strange problem with my right click menu (popup command bar) The UF that handles the cb is loaded at workook open event and it's modal*
When first right click, the commandbar is invisible, but it's there. Only shadow seems, and when click on arrow, starts showing menu. I could say that something like repaint needed. If i click on anything, next time it popups normally !!

The problem does not occur if:
1) i load the uf manually
2)* display the UF modeless

View 2 Replies View Related

Right-click Menu Doesn't Exist

Aug 9, 2009

I have few questions,

1. why the "auto sum" icon grey out, and doesn't work.

2. when I right click the sheet, the menu doesn't show up.

3. Insert columns/rows, When I highlight 2 columns/rows, right-click the mouse & the menu doesn't show up for me to choose insert col/row.

View 9 Replies View Related

Replacing The Cell Right Click Menu

Dec 30, 2009

Right click menus are a well known topic but I am struggling to find information on what I want to do with them. I have seen it done so I know its possible. What I want to do is completely replace the right click menu with my own custom one on a worksheet.

I do NOT want to add things to the existing right click menu I want to effectivly disable the existing one and put on my very own one in its place. I have looked at the code for adding a menu to a textbox etc which seems sound but I can't trigger it with an event. I don't have any code to show Im afraid as I am just playing with other people at the moment trying to get it to work.

View 9 Replies View Related

Listbox Pop Up Menu On Mouse Right Click

Feb 12, 2007

I have a list box with items. When I stay on item and press mouse right click, I want see pop up menu with "remove this item" and "add new item".

View 8 Replies View Related

Right Click Popup Menu For UserForm

Dec 17, 2007

I used the commandBar to create a right-click menu on a userForm but unfortunately I get an error 400 every time I click on the option "Edit" and I don't understand what I did wrong.

Sub CreateCmdBar()
Dim st As CommandBar
'delete the pop-up if it exists
On Error Resume Next
Application.CommandBars("flexgrid_rc").Delete
'Disables enabled error handler in the current procedure and resets it to Nothing. On Error GoTo 0
On Error Goto 0
Set st = CommandBars.Add( Name:="flexgrid_rc", Position:=msoBarPopup, Temporary:=False)
'add two menu items to the new commandbar
With st..................

View 3 Replies View Related

Right Click Menu - Adding (Paste Special)

Dec 30, 2008

I want to add Paste Values to the right click menu in Excel 2007. Can this be done without recording a separate macro to run it? What I mean is If I add the command itself to the right click menu, can it run of of the standard RightClick -> Paste Special -> Values option, or must I record a macro that does those steps each time?

View 7 Replies View Related

Customize Right Click Pop-Up Shapes Context Menu

Sep 5, 2009

I'm using Excel 2003 and am unable to find the name of, and therefore customise, the right-click shortcut menu that pops up when you right-click on a line drawn from the 'Drawing" toolbar. Basically, I'm trying to do some technical analysis on a chart. I want to be able to right-click on the lines that I draw on the chart and replicate a parallel line.

View 3 Replies View Related

Adding Face Ids To A Right Customised Right Click Menu

Jan 17, 2007

I have written some code that customises my Right-Click Menu. This works perfectly well but doesn't create the FaceIDs.Can anyone explain why? The Code is as follows

Sub CustomiseRightClickMenu()
Dim cbnRightClickMenu As CommandBarButton
Dim rngMacroNames As Range
Dim intLoopCounter As Integer
'DEFINE THE RANGE CONTAINING ALL THE MACRO NAMES
Set rngMacroNames = Sheet1.Range("MacroNames")
'DEFINE ARRAY OF FaceIDs
arrFaceIDs = Array(255, 590, 350, 536, 576, 410, 401)
On Error Resume Next
With Application
For Each Cell In rngMacroNames
. CommandBars("Cell").Controls(Cell.Formula).Delete ..............

View 2 Replies View Related

Right Click Menu Change Works 50% Of Time

Jun 13, 2007

I'm working on a sheet which uses a fair amount of indirects, deleting or adding rows bugger these up, so I wanted to replace them with a macro which does if for them and keeps the structure intact. I've sorted the macro to do this and have sorted the macro to replace delete with my delete in the cell RC menu but the row RC menu only seems to work on around 50% of the PC's? All PC's are XP with XL 2003. The code I've used is detailed below. Is this a known issue with XL or something funky with some of the PC's?

With Application
. CommandBars("Row").Controls("Delete Row").Delete
Application.CommandBars("Row").FindControl(ID:=293).Delete
Set cBut2 = .CommandBars("Row").Controls.Add(Temporary:=True, Before:=6)
End With

With cBut2
.Caption = "Delete Row"
.Style = msoButtonCaption
.OnAction = "Delete_Row"
End With

View 2 Replies View Related

Items Greyed Out On Sheet Right Click Menu

Jul 11, 2007

I cannot figure out why this setting has changed. When I right click my tab worksheet in Excel to copy or rename, it does not allow me. I will need your advice to re-activate that options so it is visible and not gray. I tried in the VBA workbook properties settings with no luck and also Tools, Options.

View 6 Replies View Related

Excel 2010 :: Right Click Formatting Context Menu?

Jun 26, 2014

In Excel 2010 onwards (probably 2007 as well) there are two right click context menus that pop up on a cells.

The "Cell" command bar and also a smaller formatting bar.

What is this bar called and if you remove it how do you get it back when you have removed all the standard bars.

VB:
Application.Commandbars("Cell").Reset

The above doesn't seem to get back the formatting bar. I did managed to get it back but through luck rather than judgement. Just through looping through every commadbar and printing it to the immediate window.

I've added the name of the context menu to each commadbar but the formatting one does not get a name put at the bottom of it. I've looked on this site and it doesn't seem to say anything about this new menu.

View 1 Replies View Related

Add Controls To Right Click Menu Based On Range List

Sep 28, 2007

I have customised the right click menu's for this spreadsheet and currently it is all hard coded. I was wondering if it is possible to dynamically modify the right click menu? The code currently has right click buttons for each staff member, and when clicked other actions are performed. I have added a "Staff" sheet and was wondering if there is a way the code can reference that sheet and create the list based on those entries for example, when new staff join or other staff leave?

I'm sure that there is a better way to go about this, perhaps a For... Next loop but I don't know enough about it. In the mean time, I will keep bashing away at it in hopes of a brainwave... it's a Friday before a long weekend and I think my brain has decided its holiday time.

Option Explicit
Private Sub Workbook_Deactivate()
On Error Resume Next
With Application
. CommandBars("Cell").Controls("Add Nick").Delete
.CommandBars("Cell").Controls("Add Toby").Delete
.CommandBars("Cell").Controls("Add Ben").Delete
.CommandBars("Cell").Controls("Add Matt").Delete
.CommandBars("Cell").Controls("Add Zoe").Delete
.CommandBars("Cell").Controls("Add Anne").Delete
.CommandBars("Cell").Controls("Add Craig").Delete
.CommandBars("Cell").Controls("Add Unknown (1)").Delete
.CommandBars("Cell").Controls("Add Unknown (2)").Delete
.CommandBars("Cell").Controls("Remove").Delete
End With
With Application
.CommandBars("Cell").Controls("Cut").Visible = True
.CommandBars("Cell").Controls("Copy").Visible = True...............................

View 2 Replies View Related

Replace Standard Shortcut Menu With Custom Menu?

Jun 24, 2014

I have created a sub to add new controls to the "Cell" shortcut menu. Can I remove the standard "Cell" shortcut menu controls? if so how do you do it?

[Code] ......

View 4 Replies View Related

Menu Bar/Navigation :: Tool That Creates A Menu Bar Or Code?

Oct 20, 2009

I have a workbook with multiple sheets. Is there a tool that creates a menu bar or code that I can add that would support navigation?

My goal is to have something with approximately 4 options (buttons?). They would link to 4 different sheets that serve as indexes within the workbook.

I know I can add a control like a button to a given sheet that would take the user to given sheet when clicked, but can I make the button 'float' above all the sheets, or add to a menu bar, or something? I just don't want to have to add the button to every sheet in the workbook.

I am looking for something simple/easy, and am not looking for anybody to do the work. I just have no idea on how to approach the problem.

View 11 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved