ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   auto update of date (https://www.excelbanter.com/excel-worksheet-functions/177628-auto-update-date.html)

gibbs

auto update of date
 
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.


Gord Dibben

auto update of date
 
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

On Fri, 22 Feb 2008 16:59:01 -0800, gibbs
wrote:

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.




All times are GMT +1. The time now is 02:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com