![]() |
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. |
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. |
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. |
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. |
All times are GMT +1. The time now is 05:07 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com