Tracking First date of the entry and the date of last change

MedExcels

New Member
Joined
Feb 18, 2016
Messages
41
Hi

I have this code (joined below to this post) to track the date entry of the invoice
When I enter the Number of the invoice for the first time in coloum B, the date of the entry will appear in the column G


There is a problem there
Assume that after two days I find that I make an error when i enter the InvoiceN° , so when I correct it , the date in column G will change


My Question Is
Is the any solution to maintain the first date entred in column G to track the date when I enter for the first time the invoice and at every change of the Invoice number Excel will return in column H the date of last change made
Thank you very muchhhhhhh

The file is in this Link

http://www.cjoint.com/c/GJvlGZVpk1Q


Thanksssssssssssssssssssssssssssssssssssssssssssssssssssssssss

<colgroup><col span="6"></colgroup><tbody>
</tbody>
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
If I understand what you want try this...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If  Target.Column <> 2 Or Target.Value = "" Then Exit Sub

On Error GoTo Handler
Application.EnableEvents = False

    If Target.Offset(0, 5) = "" Then
        Target.Offset(0, 5) = Format(Now(), "dd-mm-yyyy hh:mm:ss")
    Else
        Target.Offset(0, 6) = Format(Now(), "dd-mm-yyyy hh:mm:ss")
    End If

Handler:
Application.EnableEvents = True

End Sub
 
Last edited:
Upvote 0
If I understand what you want try this...
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

If  Target.Column <> 2 Or Target.Value = "" Then Exit Sub

On Error GoTo Handler
Application.EnableEvents = False

    If Target.Offset(0, 5) = "" Then
        Target.Offset(0, 5) = Format(Now(), "dd-mm-yyyy hh:mm:ss")
    Else
        Target.Offset(0, 6) = Format(Now(), "dd-mm-yyyy hh:mm:ss")
    End If

Handler:
Application.EnableEvents = True

End Sub

Very niceeeeeee thanksssss
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,598
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top