Static Date and Time code problem
Meant to say...it' not working.
"Laura" wrote:
Thanks Dave....
Here's the code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column < 1 Then Exit Sub
If Target.Row = 1 Then Exit Sub
If IsEmpty(Target.Offset(0, 1)) Then
Target.Offset(0, 1) = Date And Time
Target.Offset(0, 1).NumberFormat = "m/dd/yy h:mm AM/PM"
End If
End Sub
The cell is formated to date and time...here's what it looks like on the s/s:
1/00/00 12:00 AM
I've played with the code a bit...but as you can see from the example above,
it's now working.
Thanks
Laura
"Dave O" wrote:
Hi, Laura-
Will you please post your code? If you're capturing the system time
and date and writing that value to a cell, it may be just a matter of
formatting the cell to show both date and time. For instance:
Dim Datestamp as Date
Datestamp = Now()
Range("A1").value = Datestamp
In this example, if cell A1 is formatted properly, it will show both
time and date.
|