+ Reply to Thread
Results 1 to 12 of 12

Trying to get a cell to automatically input the time and date when scanned

  1. #1
    Registered User
    Join Date
    10-23-2018
    Location
    N/A
    MS-Off Ver
    Office 2010
    Posts
    7

    Trying to get a cell to automatically input the time and date when scanned

    So I am building a spreadsheet referencing serial numbers in another column when I scan a device the serial will check for that string of text and produce a value of 1 if the text is found.

    I used the following formula to reference that output of 1 in the cell to the left of the date serial scanned at facility column. "=IF(($L$4=1),NOW(),("Not Scanned"))"

    It works perfectly.

    However when I scan the next serial number, it updates all of the dates and times that I have scanned each time it scans. I'm not entirely sure why.

    Just wanted to see if there was something I was missing or another formula I could utilize to accomplish this task.

    Thanks!

    PS: I've attached screencaps for reference.
    Attached Images Attached Images

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,881

    Re: Trying to get a cell to automatically input the time and date when scanned

    You will need to leverage iterative calculation and self referencing to do time stamp (and lock), since NOW() is updated each time calculation is performed and will not be static otherwise.

    See link below for tutorial on how to use it.
    https://chandoo.org/wp/timestamps-excel-formula-help/

    Alternative is to use vba long with Worksheet_Change event to add timestamp.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    10-23-2018
    Location
    N/A
    MS-Off Ver
    Office 2010
    Posts
    7

    Re: Trying to get a cell to automatically input the time and date when scanned

    So looking at this information, would it be possible to also have the "Not Scanned" message appear by default in cells where the reference does not equal the value of 1?

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,881

    Re: Trying to get a cell to automatically input the time and date when scanned

    Yes. Something like...
    =IF(A1<>"",IF(B1="Not Scanned",NOW(),B1),"Not Scanned")

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Trying to get a cell to automatically input the time and date when scanned

    Please try enable recursive calculations from Menu file > Options > formulas > check Enable iterative calculation.

    M4
    =IF(L4=1,IF(M4<>"Not Scanned",M4,NOW()),"Not Scanned")

  6. #6
    Registered User
    Join Date
    10-23-2018
    Location
    N/A
    MS-Off Ver
    Office 2010
    Posts
    7

    Re: Trying to get a cell to automatically input the time and date when scanned

    So I think I input the formula correctly, and I am not getting any errors, however It is not giving me the correct date and time once it calculates. It is giving me 1/0/00 12:00AM as a result. Not sure what is going on. I've attached screencaps for reference.Capture_03.JPGCapture_04.JPG

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Trying to get a cell to automatically input the time and date when scanned

    Please try update value in L4

    also M4
    =IF(L4=1,IF(M4="Not Scanned",NOW(),M4),"Not Scanned")
    Last edited by Bo_Ry; 10-23-2018 at 10:15 AM.

  8. #8
    Registered User
    Join Date
    10-23-2018
    Location
    N/A
    MS-Off Ver
    Office 2010
    Posts
    7

    Re: Trying to get a cell to automatically input the time and date when scanned

    Appear to be getting incorrect date as result using this formula. Not sure why.
    Capture_05.JPG

  9. #9
    Registered User
    Join Date
    10-23-2018
    Location
    N/A
    MS-Off Ver
    Office 2010
    Posts
    7

    Re: Trying to get a cell to automatically input the time and date when scanned

    This worked! I just needed to recalculate the value in I4 so that the value in L4 would update!

  10. #10
    Registered User
    Join Date
    10-23-2018
    Location
    N/A
    MS-Off Ver
    Office 2010
    Posts
    7

    Re: Trying to get a cell to automatically input the time and date when scanned

    Now I have a secondary problem of having to manually checking Enable iterative calculation checkbox everytime I open excel or send this document out for use.

    There anyway I can enable it by default when the workbook is opened?

  11. #11
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    Office 365 ProPlus
    Posts
    5,881

    Re: Trying to get a cell to automatically input the time and date when scanned

    You'd need small piece of VBA I'd imagine. Applied to Workbook module, and tied to Workbook_Open event. Whomever that receives file must enable Macro (you can have additional layer set up to force this).
    File must be saved as .xls, .xlsm or .xlsb format.
    Ex:
    Please Login or Register  to view this content.

  12. #12
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Trying to get a cell to automatically input the time and date when scanned

    Press Alt F11

    Put below code under thisworkbook then save as .xlsm or .xlsb

    Private Sub Workbook_Open()
    Application.Iteration = True
    End Sub

+ 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. Formula for Cell to input Date&Time ONLY if Cells in the same row change info
    By TwistedFaith in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-04-2018, 04:52 AM
  2. is it possible to automatically enter date and time in a cell when it is selected
    By mkerry in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 07:01 AM
  3. Automatically place date and time in one cell when another cell has any data entered.
    By sameredith in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2012, 07:49 PM
  4. [SOLVED] input date column A, increment B, select blank cell in D and input time. in a macro
    By jeffstu in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2012, 11:19 AM
  5. [SOLVED] insert colons in time automatically when input to cell
    By Mike in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2006, 09:30 PM
  6. Automatically up date time in a cell
    By Mark in forum Excel General
    Replies: 5
    Last Post: 05-11-2005, 08:06 PM
  7. Capture cell input date/time
    By Fraggs in forum Excel General
    Replies: 0
    Last Post: 02-03-2005, 12:19 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