Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 295
Default Visual Basic - active macro on cell click

This must be really obvious but I cannot find this anywhere in HELP. I want
to set up the worksheet so that if a cell is double clicked by the user then
a particular macro will run automatically
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Visual Basic - active macro on cell click


Have a look at the Worksheet_BeforeDoubleClick event



Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cance
As Boolean)
Your code here
e.g.
test for target.cell.address
If address = A1
do something
end if

End Su

--
mudrake
-----------------------------------------------------------------------
mudraker's Profile: http://www.excelforum.com/member.php...nfo&userid=247
View this thread: http://www.excelforum.com/showthread.php?threadid=57363

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Visual Basic - active macro on cell click

Brettjg wrote:
This must be really obvious but I cannot find this anywhere in HELP.
I want to set up the worksheet so that if a cell is double clicked by
the user then a particular macro will run automatically



Hi Brettjg,

Right click the sheet tab you want this behaviour, select View Code and copy
& past this code:


Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, "A1") Is Nothing Then Call MyMacro
End Sub

change A1 with your target cell or range and MyMacro with the name of your
macro.

--
Hope I helped you.

Thanks in advance for your feedback.

Ciao

Franz Verga from Italy


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
Visual basic macro move cursor down 1 cell Roger Excel Worksheet Functions 1 September 12th 06 08:09 PM
visual basic macro help [email protected] Excel Programming 2 August 10th 06 08:53 PM
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
Visual Basic Macro negzel Excel Discussion (Misc queries) 1 December 28th 04 10:53 PM
This option(Trust access to visual basic project ) is not active . hesham Excel Programming 0 October 31st 04 01:29 PM


All times are GMT +1. The time now is 10:02 PM.

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"