Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Before DoubleClick

In this same vein, I have a macro that enters today's date in the
selected,
or target, cell by double-clicking. (It then activates the next cell
down,
which I found was necessary to complete and exit the procedure.) The
code
is below:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Target.Value = Now()
Target.NumberFormat = "mmm d"
ActiveCell.Offset(1, 0).Select
End Sub

What I would like to do is limit the operation of this procedure to a
particular column, column F, so that if someone happened to
double-click in, say, cell D5 it would not replace what is there with
today's date.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Before DoubleClick

Try this John

If Target.Column = 6 Then
' code
End If


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"John Pierce" wrote in message om...
In this same vein, I have a macro that enters today's date in the
selected,
or target, cell by double-clicking. (It then activates the next cell
down,
which I found was necessary to complete and exit the procedure.) The
code
is below:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Target.Value = Now()
Target.NumberFormat = "mmm d"
ActiveCell.Offset(1, 0).Select
End Sub

What I would like to do is limit the operation of this procedure to a
particular column, column F, so that if someone happened to
double-click in, say, cell D5 it would not replace what is there with
today's date.



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
how to use selectionchange instead of doubleclick event? ghost Excel Discussion (Misc queries) 0 December 24th 08 05:00 AM
XLT files not opening on doubleclick Daniel Excel Discussion (Misc queries) 2 August 22nd 07 03:16 PM
ON.DOUBLECLICK function C Brandt Excel Discussion (Misc queries) 8 May 20th 07 12:27 AM
Force VB to doubleclick in a cell Brettjg Excel Discussion (Misc queries) 4 March 2nd 07 03:21 PM
doubleclick PH NEWS Excel Worksheet Functions 1 March 10th 06 11:54 AM


All times are GMT +1. The time now is 01:48 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"