Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
With Target
If .Count > 1 Then Exit Sub
If .Address(0, 0) = "A1" Then
With Range("B1")
.Value = Now
.NumberFormat = "dd mmm yyyy hh:mm:ss"
End With
End If
End With
End Sub
Which will put the date/time stamp into B1 whenever A1 is selected.
That means that it will update when A1 is clicked on, tabbed into, etc.
If you want to limit the date/time stamp to mouse action, I'd recommend
using the Worksheet_BeforeDoubleClick event instead:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As _
Excel.Range, Cancel As Boolean)
With Target
If .Address(0, 0) = "A1" Then
With Range("B1")
.Value = Now
.NumberFormat = "dd mmm yyyy hh:mm:ss"
End With
End If
End With
Cancel = True 'Don't go to edit mode
End Sub
In article <00a301c27b5d$49c7efd0$35ef2ecf@TKMSFTNGXA11>, Robert
=Sheet1!A1
Of course, you could enter that directly in your destination cell.
In article <00a301c27b5d$49c7efd0$35ef2ecf@TKMSFTNGXA11>, Robert
<lin...@arco.de> wrote: