Hi Listers,
I came across some code that creates a timestamp column. I don’t know VB/VBA @ all and work extensively with TSQL, nonetheless it wasn’t too difficult to piece the concept together.
The code worked perfectly when the worksheet was open, ie. the timestamp field was updated when one particular field was updated, however, when I attempted to insert data into the particular worksheet thru SQL Server’s Integration Services (using data flow that writes exception records to an Excel destination), the records get written but the timestamp column remains blank.
Here is the the worksheet code:
>>>>>>
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
If IsEmpty(Target(1)) Then Exit Sub '-- also rejects if entire row cleared
If Target.Row = 1 Then Exit Sub
If IsEmpty(Target.Offset(0, 24)) Then
Target.Offset(0, 24) = Date
'Target.Offset(0, 24).NumberFormat = "dd-mm-yyyy hh:mm:ss"
Target.Offset(0, 24).Value = Now
End If
End Sub
<<<<<<
Could you explain what may be happening and how I might rectify this unusual behaviour, or direct me to a link that cold resolve my issue?
Many thanks in advance.
Bookmarks