PDA

View Full Version : How to update an excel cell/column date everytime a change is made to its row?



rohanjayanth
03-03-2015, 10:39 PM
Hi Friends,

I have a table in a excel spread sheet, in the some row and columns are available If I update the row end column date field should modified with current date and time option.

Can any one help me in this regard.

Thank you so much in advance.

Bob Phillips
03-04-2015, 01:26 AM
Private Sub Worksheet_Change(ByVal Target As Range)

On Error GoTo ws_exit

Application.EnableEvents = False

If Intersect(Target, Me.Columns("D")) Is Nothing Then 'assume timestamp in D

Me.Cells(Target.Row, "D").Value = Now
Me.Cells(Target.Row, "D").NumberFormat = "dd mmm yyyy hh:mm:ss"
End If

ws_exit:
Application.EnableEvents = True
End Sub

rohanjayanth
03-04-2015, 07:46 AM
sorry dear,

I have very big database table each row consist with different date, if I use the below code it is changing the whole table date.

Kindly help me how to resolve, if I have a big database.