Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default adding a right click command?

I would like to add a feature where a popup box appears when a user
right-mouse clicks on any cell in the range a1:a20. Two options should be
available when the right mouse button is depressed within that range. Option
1 will launch one macro and Option 2 will launch another.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default adding a right click command?

see Right Click Menus (Context Menus) in Excel
http://www.mvps.org/dmcritchie/excel/rightclick.htm

You would need to use worksheet deactivate and worksheet activate
instead of workbook close and open for changes to the menu.

some additional help with event macros
http://www.mvps.org/dmcritchie/excel/event.htm

Kind of think it is overkill, and that application.inputbox
would have served the purpose
http://www.mvps.org/dmcritchie/excel/inputbox.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Matt" wrote in message ...
I would like to add a feature where a popup box appears when a user
right-mouse clicks on any cell in the range a1:a20. Two options should be
available when the right mouse button is depressed within that range. Option
1 will launch one macro and Option 2 will launch another.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 516
Default adding a right click command?

David -

I like the concept, but I don't think this will work the way I want to
deploy it.
I would like the menu items to be available for this spreadsheet only and to
not require any users to run the script that will add the menu items.

Essentially, I have a spreadsheet that calculates values based on
information in cells A, B & C. Those are the only cells that are not locked
and the rest of the cells are protected. When a user right-clicks on (for
example) cell A3, the user will receive only the options to insert or delete.
Each of those options is linked to a macro that will unprotect the sheet,
run the appropriate steps, and reprotect the sheet.

On a separate note: Do you know a function that can fill a cell with a
formula based on the cells location?
Details (using a simplified formula):
E5 =if(B5<0,C5*D5,"")
If the selected cell is anywhere on row 120, I want the macro to fill in
cell E120 with =if(B120<0,C120*D120,""). I prefer not to use E5 as the
reference in case the row is deleted.



"David McRitchie" wrote:

see Right Click Menus (Context Menus) in Excel
http://www.mvps.org/dmcritchie/excel/rightclick.htm

You would need to use worksheet deactivate and worksheet activate
instead of workbook close and open for changes to the menu.

some additional help with event macros
http://www.mvps.org/dmcritchie/excel/event.htm

Kind of think it is overkill, and that application.inputbox
would have served the purpose
http://www.mvps.org/dmcritchie/excel/inputbox.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Matt" wrote in message ...
I would like to add a feature where a popup box appears when a user
right-mouse clicks on any cell in the range a1:a20. Two options should be
available when the right mouse button is depressed within that range. Option
1 will launch one macro and Option 2 will launch another.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 903
Default adding a right click command?

Hi Matt,
Take a look at event macros
http://www.mvps.org/dmcritchie/excel/event.htm

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Matt" wrote in message ...
David -

I like the concept, but I don't think this will work the way I want to
deploy it.
I would like the menu items to be available for this spreadsheet only and to
not require any users to run the script that will add the menu items.

Essentially, I have a spreadsheet that calculates values based on
information in cells A, B & C. Those are the only cells that are not locked
and the rest of the cells are protected. When a user right-clicks on (for
example) cell A3, the user will receive only the options to insert or delete.
Each of those options is linked to a macro that will unprotect the sheet,
run the appropriate steps, and reprotect the sheet.

On a separate note: Do you know a function that can fill a cell with a
formula based on the cells location?
Details (using a simplified formula):
E5 =if(B5<0,C5*D5,"")
If the selected cell is anywhere on row 120, I want the macro to fill in
cell E120 with =if(B120<0,C120*D120,""). I prefer not to use E5 as the
reference in case the row is deleted.



"David McRitchie" wrote:

see Right Click Menus (Context Menus) in Excel
http://www.mvps.org/dmcritchie/excel/rightclick.htm

You would need to use worksheet deactivate and worksheet activate
instead of workbook close and open for changes to the menu.

some additional help with event macros
http://www.mvps.org/dmcritchie/excel/event.htm

Kind of think it is overkill, and that application.inputbox
would have served the purpose
http://www.mvps.org/dmcritchie/excel/inputbox.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Matt" wrote in message ...
I would like to add a feature where a popup box appears when a user
right-mouse clicks on any cell in the range a1:a20. Two options should be
available when the right mouse button is depressed within that range. Option
1 will launch one macro and Option 2 will launch another.






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


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADD A COMMAND TO MOUSE RIGHT CLICK frankoklahoma Setting up and Configuration of Excel 1 August 23rd 09 09:45 PM
Command Button Click bmolintas Excel Discussion (Misc queries) 4 November 8th 07 10:37 PM
Name of Text-Box Right-Click Command Bar? Altamont Excel Discussion (Misc queries) 1 September 26th 06 09:07 PM
Add Command to Right-Click Menu Andy Excel Programming 3 January 11th 05 02:00 PM
How to add a command button and on-click within vba Papa Jonah Excel Programming 9 December 2nd 04 12:10 AM


All times are GMT +1. The time now is 06:39 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"