Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Is it possible run code when a cell is doubleclicked?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
sumGirl - 16 Feb 2007 13:56 GMT
Is it possible run code when a cell is doubleclicked?
merjet - 16 Feb 2007 14:13 GMT
Yes. Suppose you want the code to run if the user clicks on cell B5.

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Target.Address = "$B$5" Then
   'do something
End If
End Sub

In he VB Editor put this in the worksheet's module.

Hth,
Merjet
sumGirl - 16 Feb 2007 14:21 GMT
Chip Pearson - 16 Feb 2007 20:57 GMT
> If Target.Address = "$B$5" Then
>    'do something
> End If

You probably want to set Cancel = True in this code:

If Target.Address = "$B$5" Then
   'do something
   Cancel = True
End If

Signature

Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

> Yes. Suppose you want the code to run if the user clicks on cell B5.
>
[quoted text clipped - 9 lines]
> Hth,
> Merjet
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.