How do I code a cell to display the current date on double-click?
If the cell for your date is range named, say "main.date" then your
doubleclick event is easier to follow
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel
As Boolean)
Dim rDate As Range
Set rDate = ThisWorkbook.Names.Item("main.date").RefersToRange
If Target.Address = rDate.Address Then
Cancel = True
Target.Value = Now
End If
End Sub
HTH
Patrick Molloy
Microsoft Excel MVP
"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
|