Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
famdamly
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default 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
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
double click excel file on the desktop excel opens but not file? JPT4266 Excel Discussion (Misc queries) 3 May 7th 09 04:24 PM
I have to double click a cell for the "text" format to take Charles Excel Discussion (Misc queries) 2 January 24th 06 02:46 PM
How do I double click a cell and jump to cell's referenced cell JerryJuice Excel Discussion (Misc queries) 2 September 10th 05 10:24 PM
why do 5 workbooks open when I double click one dnlighting Excel Discussion (Misc queries) 2 August 15th 05 08:31 PM
Can I launch macro by a cell click ? Cedric Dennis Excel Discussion (Misc queries) 2 March 11th 05 04:34 PM


All times are GMT +1. The time now is 07:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"