Announcement

Collapse
No announcement yet.

Automatically insert time stamp in adjacent cell when changing values

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Automatically insert time stamp in adjacent cell when changing values

    How can I have a cell (or series of cells) with a time stamp that won't change every time I enter data into other cells? I want to be able to put a date in [A1] and have a time show up in [B1]. Another date in [A2] with a new time stamp in [B2] without it changing the time in [B1] And so on. Any help would be appreciated.
    Last edited by AAE; January 6th, 2011, 21:13. Reason: revise thread title

  • #2
    Re: Time stamp

    Using a macro?

    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
     
    If Target.Column = 1 Then
    ActiveCell.Offset(0, 1) = Format(Now(), "HH:MM:SS")
    End If
     
    End Sub

    Comment


    • #3
      Re: Time stamp

      Or for in cell use.

      =IF(A1 >0,NOW(),"")

      HTH
      The Only Dumb Question Is A Question Not Asked.

      Comment


      • #4
        Re: Time stamp

        Yegar,
        That will change with every sheet calculation.

        Comment


        • #5
          Re: Time stamp

          Ohh.....well i hadn't thought of that :/ good point. Just trying to help. But i did learn somthing new. Thanks Justin. Cheers
          The Only Dumb Question Is A Question Not Asked.

          Comment


          • #6
            Re: Time stamp

            That's the delima I've been having. Unforunately I need to brush up on macros and VB.....it's been a long time since I've used them. Thanks for everyones help.

            Comment


            • #7
              Re: Time stamp

              Assuming that Column B is just a timestamp column and contains no other information, and you only want to enter the system time when data is first entered in column A, slightly modifying Justins code gives...
              Code:
              Private Sub Worksheet_Change(ByVal Target As Range)
                 If Target.Column = 1 And Target.Offset(0, 1).Value = "" Then
                    Target.Offset(0, 1) = Format(Now(), "HH:MM:SS")
                 End If
              End Sub

              Comment


              • #8
                Re: Automatically insert time stamp in adjacent cell when changing values

                Hello Taybo,

                Welcome to Ozgrid. We're glad to have you here at Ozgrid, however, please note the following regarding thread titles.

                Thread titles are used in searching the forum, therefore, it is vital the be written to accurately describe your thread content or overall objective using ONLY search friendly key words.
                • The title must not use non-essential words such as:"Help needed", "Formula problem", "Please help", "urgent", "Code issue", "Need Advice", etc. Such words dilute the title/search results.
                • The title should not contain VBA code or formula syntax or use abbreviations, jargon, delimiters
                • The title should not assume or anticipate a solution as in referencing Excel functions or VBA methods - the actual solution is often quite different
                • The title must not consist of a single word description; such titles do not fully describe the thread


                Please note the change to your title, which is based on the objective stated in your thread.
                AAE
                ----------------------------------------------------

                Forum Rules | Message to Cross Posters | How to use Tags

                Comment


                • #9
                  Re: Automatically insert time stamp in adjacent cell when changing values

                  hi,
                  thanks for all your help. I was already able to timestamp at column A whenever I input anything at any row adjacent it, but when a value in a cell in that row changes because it's a formula (eg. =2*A3) time doesn't change.help please.thanks.

                  Comment


                  • #10
                    Re: Automatically insert time stamp in adjacent cell when changing values

                    Hi,

                    This thread is more than a little old, it is probably best to start a new one.
                    Also you need to be a little clearer in what you are looking for in the description; break it down a little more.

                    Comment


                    • #11
                      Re: Automatically insert time stamp in adjacent cell when changing values

                      Welcome to Ozgrid, joy0525.

                      The Worksheet Change event is not raised when a cell changes as the result of a recalculation. This is a common issue and workarounds can be easily found on the board.

                      However, we prefer you do not post questions in old threads. If you cannot find a solution, please start your own thread.

                      Comment

                      Working...
                      X