+ Reply to Thread
Results 1 to 7 of 7

how to auto input date & time, which will not auto update

  1. #1
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Question how to auto input date & time, which will not auto update

    Dear All,
    i want to input current date & time in Cell B1, if i write something on cell A1 then current time will show on B1
    i can do this with below code
    =IF(A1<>"",NOW(),"")
    but time is updating. how can i do that, but time will not change after that,

    TIA
    Last edited by emmr; 03-25-2020 at 02:18 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: how to auto input date & time, which will not auto update

    1) by iterative calculations - rather not recommended, as this will affect the rest of your workbook
    2) by using a Worksheet Change event handler (you need to have macros enabled workbook)

    The code could look like that:
    Please Login or Register  to view this content.
    and should be located in the sheet code (right click on sheet tab and select show code from pop-up menu)

    See attachment - allow active content and write something in any cell in column A
    Attached Files Attached Files
    Last edited by Kaper; 03-25-2020 at 03:21 AM.
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: how to auto input date & time, which will not auto update

    ok i can do this, but what ill be the macro to do so plz help Kaper

  4. #4
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: how to auto input date & time, which will not auto update

    thanks a lot kaper for your help

    this is my final code

    Please Login or Register  to view this content.
    if i write in cell C2 then date and time showing in D2 and the date & time of D2 is locked
    its worked for me,
    but its have a limitation,
    if the delete the value from C2 and write again on C2 then the date & time updated.
    how could i protect that, like if value imputed on D2 that will not delete, remove, editable ect. whatever we do with C2
    would you plz help me with that

    TIA

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: how to auto input date & time, which will not auto update

    How about protecting cell Cx when it has been filled?
    like:
    Please Login or Register  to view this content.
    But this requires not unlocking them at the beginning
    Please Login or Register  to view this content.
    By the way, as changes are made to next column disabling and then enabling events is not necessary if you limit your "work field" with Intersect
    Last edited by Kaper; 03-25-2020 at 07:00 AM. Reason: just corrected code tags

  6. #6
    Forum Contributor
    Join Date
    07-25-2019
    Location
    Dhaka, Bangladesh
    MS-Off Ver
    2016
    Posts
    200

    Re: how to auto input date & time, which will not auto update

    Dar Kaper this time im not clear with your communication
    would you plz prove me the total clear code for this task with an excel file if i can make is clear to you, it will be very much helpful
    thanks a lot

  7. #7
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: how to auto input date & time, which will not auto update

    Of course not tested, because somehow you refrain from attaching a file …

    Please Login or Register  to view this content.

    The protection part
    Please Login or Register  to view this content.
    could go into workbook open event (in Thisworkbook module) but as a matter of fact if it has been applied once it does not need to be re-applied every time.
    If you decide to do it in workbook open, or keep it in worksheet change handler, I'd recommend rather such approach:

    Please Login or Register  to view this content.

+ 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. Replies: 1
    Last Post: 06-14-2018, 02:48 PM
  2. Replies: 0
    Last Post: 06-12-2018, 05:22 AM
  3. [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
  4. Auto color time sheet after user input
    By Barry66 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-27-2012, 05:26 PM
  5. Replies: 3
    Last Post: 06-16-2012, 12:51 PM
  6. Auto Sort, Auto Lock, Auto Date & Time Stamp
    By suehatesyou in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2010, 02:57 PM
  7. Date & time auto generated based on input date & time
    By BlastRanger in forum Excel General
    Replies: 18
    Last Post: 09-08-2010, 03:54 AM

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