+ Reply to Thread
Results 1 to 9 of 9

Timestamps in B when data is added in A

  1. #1
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Cool Timestamps in B when data is added in A

    I have no what I am doing when I comes to excel VBA programming. What I need is a simple code where if for example A1 is filled in with a value (could be anything) B1 is filled with current time and date. Then the code jumps down one row.
    Last edited by Bartor; 08-01-2022 at 04:37 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Timestamps in B when data is added in A

    In the module for the worksheet containing the data, add this code:
    Please Login or Register  to view this content.
    Let me know if you need me to walk you through the details of how to install this code.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

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

    Re: Timestamps in B when data is added in A

    1) Copy this code.
    2) Right-Click the sheet tab of interest.
    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.
    Bernie Deitrick
    Excel MVP 2000-2010

  4. #4
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Re: Timestamps in B when data is added in A

    I have tried this code, but when I try to run, it won't allow me to select the which macro to run. Is there any way for me to fix this?

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,982

    Re: Timestamps in B when data is added in A

    You do not run this macro. It runs automatically whenever you change a value in column A.

    Bernie's code always put the date/time in B1 no matter where the update was made in column A. My impression is that you actually want the date/time in the same row as the new value in column A. Please confirm.

    Quote Originally Posted by Bernie Deitrick View Post
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Re: Timestamps in B when data is added in A

    I am trying to write something in column A, then have the date and time be automatically written in column B. Then go down to the next row.
    Last edited by Bartor; 07-29-2022 at 03:05 AM.

  7. #7
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Re: Timestamps in B when data is added in A

    Ignore the last reply, I meant that I had to use your code 69StringJazzer?

  8. #8
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Re: Timestamps in B when data is added in A

    I also get an error saying that macros aren't enabled, is this because of the code or is it another matter?

  9. #9
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Re: Timestamps in B when data is added in A

    Fixed it, and now it works.

    Thanks for the help

+ 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: 2
    Last Post: 05-20-2022, 09:09 AM
  2. Google Sheets: Calculate End Date & Time from Start Date & Time for given Duration
    By vigneshslm in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 3
    Last Post: 02-13-2021, 09:54 PM
  3. Replies: 7
    Last Post: 06-19-2017, 06:10 PM
  4. Replies: 9
    Last Post: 02-15-2015, 07:32 PM
  5. Replies: 3
    Last Post: 12-19-2013, 06:49 AM
  6. Calculation of time difference between the Start date & time & End Date & time
    By Harry Jones in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-17-2012, 03:54 PM
  7. Calculating days & time left from start date/time to end date/time
    By marie in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-07-2005, 10:40 AM

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