auto update of date

G

gibbs

Dear all,
IN my pricing list
one is numeric in which i am entering prices and other one is date , which
gives me the information of on which date i received the prices for
particular product.
My problem is can i update the date of price automatically, once i update
the new price. Many times, I forget to change the date resulting i cant take
various decisions based on pricing.
 
G

Gord Dibben

Auto means code in most instances.

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range("A:A")) Is Nothing Then
With Target
If Not .Value = "" Then
.Offset(0, 1).Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
End If
ws_exit:
Application.EnableEvents = True
End Sub

As you enter a price in column A, a date/time will be entered in column B

This is event code. Right-click on the sheet tab and copy/paste into that
module.

Alt + q to return to Excel window.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top