Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Run macro on double click only
Let's say I have an item that I want to select with one click, and run a macro with a second click. How can this be done? -- famdamly ------------------------------------------------------------------------ famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382 View this thread: http://www.excelforum.com/showthread...hreadid=516789 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Run macro on double click only
Use the double-click event
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _ Cancel As Boolean) ... your code here End Sub This is worksheet event code, which means that it needs to be placed in the appropriate worksheet code module, not a standard code module. To do this, right-click on the sheet tab, select the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "famdamly" wrote in message ... Let's say I have an item that I want to select with one click, and run a macro with a second click. How can this be done? -- famdamly ------------------------------------------------------------------------ famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382 View this thread: http://www.excelforum.com/showthread...hreadid=516789 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Run macro on double click only
I think Bob meant:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _ Cancel As Boolean) Cancel = true 'your code here End sub If you have "tools|options|edit tab|edit directly in cell" checked, then the "Cancel = true" tells excel to not edit the cell. Bob Phillips wrote: Use the double-click event Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, _ Cancel As Boolean) ... your code here End Sub This is worksheet event code, which means that it needs to be placed in the appropriate worksheet code module, not a standard code module. To do this, right-click on the sheet tab, select the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "famdamly" wrote in message ... Let's say I have an item that I want to select with one click, and run a macro with a second click. How can this be done? -- famdamly ------------------------------------------------------------------------ famdamly's Profile: http://www.excelforum.com/member.php...o&userid=29382 View this thread: http://www.excelforum.com/showthread...hreadid=516789 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
double click excel file on the desktop excel opens but not file? | Excel Discussion (Misc queries) | |||
I have to double click a cell for the "text" format to take | Excel Discussion (Misc queries) | |||
How do I double click a cell and jump to cell's referenced cell | Excel Discussion (Misc queries) | |||
why do 5 workbooks open when I double click one | Excel Discussion (Misc queries) | |||
Can I launch macro by a cell click ? | Excel Discussion (Misc queries) |