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


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

Macro To Select A Menu Item

Apr 5, 2007

I am wondering if there is any code to SELECT (DESELECT) A MENU ITEM using VBA? I have an Excel Add-in program installed, which adds a Menu "Easycal" to my Excel menu bar. Under "Easycal" (drop down list), I have the following items:

Refresh workbook
Refresh worksheet
Turnoff Easycal

I am using "Easycal"'s functions in various cells of my sheet "Final". When I select "Refresh worksheet" from "Final", "Easycal" fetches (or calculates) me the data from the "Easycal" database. I have a macro (on "Final") that pulls together data from other sheets of the same workbook. I there anyway to include a code in my existing macro, so that when I run the macro, the following are completed in sequence:

1. Select "Turnoff Easycal" menu item
2. Run my existing macro (to pull the data from other sheets to "Final")
3. DeSelect "Turnoff Easycal" menu item
4. Select "Refresh worksheet" menu item

View 3 Replies View Related

Click Item In ListBox1 And ListBox2 Item Is Also Selected Simultaneously?

Feb 16, 2013

Excel Userform

'enables user to click [U]highlight and select[/U] an item in ListBox1 and ListBox2 item (same row in index) is also [U]highlighted[/U] (highlighted only not selected)
Private Sub ListBox1_Click()
ListBox2.ListIndex = ListBox1.ListIndex
End Sub

Question: Is it also possible to enable a user to click to select an item in ListBox1 and ListBox2 item is also selected simultaneously (same row in index). Is there excel vb code to do this?

I think the code may be along the lines of the ListBox SelectedIndex property. What would be the Excel VB code equivilant for the ListBox SelectedIndex property, if so?

View 8 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

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
'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
Set rngMacroNames = Sheet1.Range("MacroNames")
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
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

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 View Related

Double Click On Listbox Item To Run A Code?

Jun 4, 2014

I have a 2 column listbox storing Policy Number and Number of pages. Suppose it has 10 records. Now I want the code so that when I double click on a particular policy number of the listbox then I should be able to make the changes in that. (it might be changing the ppolicy number or number of pages if the user types something wrong by mistake)

View 1 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.


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
End With
With Application
.CommandBars("Cell").Controls("Cut").Visible = True
.CommandBars("Cell").Controls("Copy").Visible = True...............................

View 2 Replies View Related

VBA Double-click Item From Listview Not Firing Events

Apr 22, 2014

I've created a ListView4 object on MyForm and called it 'MyListView'. I'm able to successfully display it and populate it with a list of items (2 columns). So far, so good.

I'm trying to intercept a double-click on an entry in the listview so I can process the selected value and close the ListView. Unfortunately, the MyListView_DblClick event apparently does not get triggered (I've also tried other events, but can't get them to work also).

View 2 Replies View Related

Mouse Click Selects Wrong Listbox Item

Oct 2, 2013

A list box selection works fine on my computer but on a friends Windows Vista PC the following happens:

Selecting items near the top of the list works fine. 1/4 of way down a mouse click on an item selects the Next item.
1/2 of the way down in the list, the mouse click on an item selects the one 2 or 3 further down, etc., etc.

View 1 Replies View Related

Delete Currently Displayed Combobox Item With Commandbutton Click

Dec 13, 2009

I have a combobox which is manually scrolled through using the down arrow key. As the different combobox items are viewed, I would like to be able to delete the currently viewed item from the list if desired by clicking on a commandbutton.

The list items are contained in the range of B2:B500. Also, since this places a gap in the list, I would like to shift the remaining cells values in column B up to close the gap.

View 9 Replies View Related

Excel 2010 :: Run Listbox CLICK Event After Item Is Selected?

Feb 21, 2013

Excel 2007/2010.

Hope this is fairly easy to solve. I have Screen #1 with a listbox with a CLICK event. The event populates a combobox below (with items based on listbox's selection). Listbox is NOT multi-select. Code runs fine manually, i.e., user opens screen selects from listbox, then can select from combobox.

I now what to open and make selections from another form/screen, Screen #2. I've written code to select the proper item from Screen #2's listbox but this does NOT trigger the listbox's CLICK event for me so the combobox isn't populated so I can then make that selection from Screen #1, also. I've tried setting focus to listbox first, then making selection, but that doesn't work.

QUESTION: Is there code that selects from a listbox in a way that mimics the user clicking the selected item in the listbox?

The alternatives I can think of are:
1) Change Screen #2's listbox code from CLICK to CHANGE event, but I'd rather not.
2) Move CLICK event code to sub-procedure and then call from both listbox CLICK and Screen #2 code
3) Some sendkey string like ENTER?

Would be easier to just mimic the user click, if possible.

With frm_Screen2
'Select item type from listbox
With .LBox_Items


View 7 Replies View Related

Copyrights 2005-15, All rights reserved