+ Reply to Thread
Results 1 to 15 of 15

time stamp

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    CA
    MS-Off Ver
    2010
    Posts
    20

    time stamp

    Here is what I am looking to do and I have wasted to much time trying to do it myself.

    A1 - a changing number, each time it changes I want B to time stamp down the column.

    EX. User states
    A1 = 1 B1 = MM:DD:YY HH:MM:SS
    A1 = 3 B2 = MM:DD:YY HH:MM:SS
    A1 = 7 B3 = MM:DD:YY HH:MM:SS
    A1 = 19 B4 = MM:DD:YY HH:MM:SS


    PLEASE HELP POST HASTE BEFORE I LOSE MY MIND!

  2. #2
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: time stamp

    Developer Ribbon. Visual Basic, Right click on the name of the worksheet where the date is required, 'view code, 'paste the following code into the blank box. Make sure that "This code goes in "Active worksheet" has a ' before it.


    HTML Code: 
    Last edited by BlindAlley; 01-14-2016 at 02:27 PM.

  3. #3
    Registered User
    Join Date
    07-02-2014
    Location
    CA
    MS-Off Ver
    2010
    Posts
    20

    Re: time stamp

    I must be doing something wrong. I went to Developer, Visual Basic, General, Worksheet Change and pasted

    Option Explicit

    Private Sub Worksheet_Change(ByVal Target As Range)
    SetDateRow Target, "B"
    'or
    'SetDateCol Target, 2
    End Sub

    Sub SetDateRow(Target As Range, Col As String)
    If Target.Cells.Count > 1 Then Exit Sub
    Application.EnableEvents = False
    Cells(Target.Row, Col) = Int(Now())
    Application.EnableEvents = True








    It's not working.

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: time stamp

    The code is missing
    End Sub at the end so the complete code would be
    ''This code goes in "Active worksheet"

    Please Login or Register  to view this content.
    You can enter the code in your workbook by right clicking on a worksheet tab, choose View Code and Paste the code into the module that is presented to you . Click on the X of the main editor window to close.

    Enter something along the row (not in column B) and when you hit enter or tab or otherwise go to another cell the date will be entered in column B of the row that you were working in. If you want the time, change =Int(now()) to =Now()
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: time stamp

    This works as well


    Copy this code into the Active Worksheet without the HTML Tags

    HTML Code: 
    Attached Files Attached Files
    Last edited by BlindAlley; 01-14-2016 at 03:27 PM.

  6. #6
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: time stamp

    @Newdoverman

    My Mistake - I rushed to copy the code and missed the End Sub, thanks for correcting it.

  7. #7
    Registered User
    Join Date
    07-02-2014
    Location
    CA
    MS-Off Ver
    2010
    Posts
    20

    Re: time stamp

    For whatever reason when I attempt to open the specific worksheet VBA, a grey blank screen pops up, it's unlike the normal white screen where you can chose your project and paste the information. I have no clue what is wrong with this thing.

  8. #8
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: time stamp

    Can you post part of your file without sensitive data.

    Go to advanced - manage attachments -add files - browse for your file - upload - insert in line (1) - done
    Last edited by BlindAlley; 01-14-2016 at 03:28 PM.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: time stamp

    @ BlindAlley
    No problem, glad to have helped.

  10. #10
    Registered User
    Join Date
    07-02-2014
    Location
    CA
    MS-Off Ver
    2010
    Posts
    20

    Re: time stamp

    So I feel like we are very close to what I was looking for. In your attached excel sheet, "Time date Stamp", the way you have designed this was that the user would have to input data in cells A2 thru A10. I was looking for a single point of data entry on another sheet, in the attached scenario, on sheet 1 the user would input the data into block I2, ( I have a macro that accumulates the time on J2 and clears I2 after input) but I want it to time stamp on Sheet 2 each time information is input into I2. This may be to much, but this is really what I was hoping to achieve. So on sheet 2, each time information is entered onto Sheet 1 I2, a time stamp would appear on sheet 2 A1, A2, A3, A4, A5, A6 etc. Does this make sense and is this obtainable? Please keep in mind that multiple users use this sheet and there will be multiple points of data entry, Ex, I2, I3, I4, I5, etc. Approx 50. time-stamp-time-date-stamp.xlsm

  11. #11
    Registered User
    Join Date
    07-02-2014
    Location
    CA
    MS-Off Ver
    2010
    Posts
    20

    Re: time stamp

    time-stamp-time-date-stampR1.xlsmThe more I think about it, Is it possible that each time a number is entered onto sheet 1 I2, a copy of that information is carried over to Sheet 2 with a time stamp even though I2 is designed to erase after input. attached is a created scenario that I made up implying that 3 inputs were made each of user input 2 for a total of 6. Let me know if this is doable because this would capture the data best I believe. Thanks for looking!

  12. #12
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: time stamp

    Please Login or Register  to view this content.

  13. #13
    Valued Forum Contributor
    Join Date
    04-26-2015
    Location
    Toronto, Canada
    MS-Off Ver
    2010
    Posts
    502

    Re: time stamp

    Hi Dave,

    I tested your code but I get an 'ambiguous name change' error when I edited the set sheet name to my second sheet name of "Tab Stamp" .

    Also, does this code get placed in 'Workbook, Sheet 1, Sheet 2 or a module' ?

  14. #14
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: time stamp

    The code is a worksheet_change event, it would go into the sheet that is being changed.

    I can only assume you pasted the code into the sheet1 module but did not delete your original code

    Please Login or Register  to view this content.
    Attached Files Attached Files

  15. #15
    Registered User
    Join Date
    07-02-2014
    Location
    CA
    MS-Off Ver
    2010
    Posts
    20

    Re: time stamp

    So this is amazing and works perfect. Now to add another pickle to the puzzle. Can we add a user ID to the time stamp. As an example, 10 people have access to this shared work book. Although each line item is tasked to a specific person, I'm curious If it can not who input the data in block C.

    Also, how do I change the code to add all of the other lines, ex, I4, I6, I8, I10...

+ 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. determine if a certain time stamp falls into a certrain time range
    By tomsemea in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2015, 11:13 AM
  2. Computer time stamp -> excel time stamp
    By j.petrut in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-27-2014, 05:49 PM
  3. How to get time stamp and user name stamp
    By eskains in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2013, 09:44 AM
  4. Replies: 3
    Last Post: 11-06-2012, 01:37 AM
  5. [SOLVED] Extract a time from a cell with date and time stamp and then perform calculations
    By Marcos Aristotelous in forum Excel General
    Replies: 3
    Last Post: 10-31-2012, 04:36 AM
  6. Replies: 3
    Last Post: 02-22-2011, 01:53 PM
  7. time stamp a cell that doesn,t change when time stamping another
    By RC in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-12-2005, 10:05 PM

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