+ Reply to Thread
Results 1 to 7 of 7

Creating a date/time stamp on document when ever there is a change made

  1. #1
    Registered User
    Join Date
    03-09-2024
    Location
    South England
    MS-Off Ver
    OFFICE 365
    Posts
    22

    Creating a date/time stamp on document when ever there is a change made

    Hi there,

    Thanks for taking you time and looking at my problem.

    I have tired YouTube but for some reason cannot get it to work, could be something simple I'm just not that clued up with Macros/VBA.

    I have 2 separate excel spread sheets, they communicate to each other though XLOOKUP.

    #1 Yard Sheet - this is updated by our forklift guys out in the yard
    #2 Trailer Plan - this is for the office staff to see what trailers are where and whether there empty or loaded.

    i would like the trailer plan to have a date and time stamp so the office can see when it was last updated.

    hope you can help?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,308

    Re: Creating a date/time stamp on document when ever there is a change made

    To determine if a value has changed, every formula's result needs to be compared to its previous value. To do that, insert a new worksheet in your workbook, and name it Values. That sheet will be used to store values as values, for comparison. Then

    1) Copy the code below
    2) Right-Click the sheet tab of "DC TRAILER PLAN"
    3) Select "View Code"
    4) Paste the code into the window that appears.
    5) Save the file as a macro-enabled .xlsm file.
    6) Make changes as needed

    Please Login or Register  to view this content.
    When the linking formulas update on that sheet (whether anything changes or not), the code will compare the stored values to the current values, and if it finds any changes, it will update the date time stamp and copy all the new values into the storage sheet.

    PS - when you post a workbook for help, remove the protection from the workbook: I would have made all the changes to your actual workbook but could not because of the password protection.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    03-09-2024
    Location
    South England
    MS-Off Ver
    OFFICE 365
    Posts
    22

    Re: Creating a date/time stamp on document when ever there is a change made

    Thanks for your help.

  4. #4
    Registered User
    Join Date
    03-09-2024
    Location
    South England
    MS-Off Ver
    OFFICE 365
    Posts
    22

    Re: Creating a date/time stamp on document when ever there is a change made

    Hi Bernie,

    after many attempts to get this to work i always have the same error come up with line -

    If rngC.Value <> Worksheets("Values").Range(rngC.Address).Value Then

    not sure whats causing the error as VB is well out of my league.

    If at all possible, could you please do it for me?
    I have reattached both documents with out any locks on.
    As i was unaware that the original documents had.

    TEST - DC TRAILER PLAN.xlsmTEST - YARD SHEET.xlsx

    Thanks for your help!

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,308

    Re: Creating a date/time stamp on document when ever there is a change made

    Sorry about that - I thought that both workbooks would not be open on the same machine (that you would be updating links only - the yard sheet would be used in the yard by other workers....). I guess I should have anticipated your need to test the code

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-09-2024
    Location
    South England
    MS-Off Ver
    OFFICE 365
    Posts
    22

    Re: Creating a date/time stamp on document when ever there is a change made

    Perfect! works great. Thanks Bernie.

  7. #7
    Registered User
    Join Date
    03-09-2024
    Location
    South England
    MS-Off Ver
    OFFICE 365
    Posts
    22

    Re: Creating a date/time stamp on document when ever there is a change made

    Hi Bernie,

    after it working perfect in the test document, we moved it over to the main document with all the information populated into it.

    we started having issue, in the middle of our "DC TRAILER PLAN". We have a counter that counts the amount of trailers that we have with different categories..
    They link to another tab called "TRAILER INFORMATION" which does the initial count and we feed the information from.

    "TRAILER INFORMATION TAB" -------------------- ---------- "DC TRAILER PLAN" COUNTER
    Screenshot 2024-06-27 105155.png Screenshot 2024-06-27 105136.png

    When linking from the "DC TRAILER PLAN" tab to the "TRAILER INFORMATION" tab we have a run time error, showed below. -

    I'm using the simple ='TRAILER INFORMATION'!F1 to feed the information across. then we get -
    Screenshot 2024-06-27 104809.png

    also can cause excel to crash.

    It worked fine for storage trailers and bottle trailers but not stock or MT trailers.

    when the error comes up and we use the debug button it shows an issue with the same line as before? -

    If rngC.Value <> ThisWorkbook.Worksheets("Values").Range(rngC.Address).Value Then

    Thanks again Bernie.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Change Date and Time stamp when time is less than 8 AM
    By jprlimey in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-15-2020, 12:11 PM
  2. [SOLVED] Calculation change date time stamp
    By mumzy in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-13-2016, 12:36 PM
  3. Need vba code to change date&time stamp as date format dd-mmm-yy in A:A rng
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2014, 06:08 AM
  4. Date & Time stamp for change in value
    By drguruji in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-28-2014, 04:09 AM
  5. date time stamp - not to change
    By marsha7 in forum Excel General
    Replies: 5
    Last Post: 03-08-2012, 02:46 PM
  6. Excel Status Change w/ Time/Date Stamp
    By ritmoteca in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-14-2007, 10:43 AM
  7. individually time stamp a row when a change is made to that row
    By chuck in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-27-2006, 02:10 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1