View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Jones Jim Jones is offline
external usenet poster
 
Posts: 6
Default How do I code a cell to display the current date on double-click?


Yes, this example below seems to work just fine.
Please tell me, I'd like to know how to write this stuff, but I can't
learn it on my own. Is there a site or a good book, loaded with such
macro/module examples?

Thanks,
Jim

Hi,

Write the BeforeDoubleClick of worksheet as follow:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Target.Column = 2 Then' for second(B) column
Target.Value = Now()
End If
End Sub

Regards,

Vinit


George wrote:
Hi, I want to be able to have the current date entered into a given
cell, when I double-click it.

It will always be a cell, in one particular column, reserved for

date.
Jim