+ Reply to Thread
Results 1 to 16 of 16

Recording time for dynamically changing cell values

  1. #1
    Registered User
    Join Date
    06-02-2016
    Location
    mumbai,india
    MS-Off Ver
    2007
    Posts
    18

    Recording time for dynamically changing cell values

    Is it possible to record only time in B1 when a cell A1 in sheet1 changes dynamically not manually

    Like that around I need 5 cells say A1,A2,A3,A4,A5 record time when they get updated automatically in B1,B2,B3,B4,B5 respectively

    so like this whenever changes occur in these cells that time should be recorded automatically every time.

    Hope your answer helps me

    Thank you

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Recording time for dynamically changing cell values

    Hello
    Using the worksheet change event for A1:A5:

    Please Login or Register  to view this content.
    DBY

  3. #3
    Registered User
    Join Date
    06-02-2016
    Location
    mumbai,india
    MS-Off Ver
    2007
    Posts
    18

    Re: Recording time for dynamically changing cell values

    Sir,this code was working only when "A" column cells are changed manually,not when it was formulae or dynamically changing value,

    Sir is it possible to get only time not date......

    TQ

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Recording time for dynamically changing cell values

    Hello
    Sorry, wasn't thinking correctly, I thought you meant the Time to be recorded automatically. It's a little more difficult to do but after a bit of research I found the following code:

    Please Login or Register  to view this content.
    If A1:A5 have formulas and their values change then the time stamp is placed in the adjacent column.

    Hope this is what you're looking for.
    DBY

  5. #5
    Registered User
    Join Date
    06-02-2016
    Location
    mumbai,india
    MS-Off Ver
    2007
    Posts
    18

    Re: Recording time for dynamically changing cell values

    Sir ,
    I pasted this recent code but nothign was happening sir,
    no time is recorded.can you guide me how to use this code perfectly

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Recording time for dynamically changing cell values

    Are you placing the code in the correct place? It needs to go into the Worksheet Change Event. Attached is a screenshot.


    VBA Editor Screenshot.jpg

  7. #7
    Registered User
    Join Date
    06-02-2016
    Location
    mumbai,india
    MS-Off Ver
    2007
    Posts
    18

    Re: Recording time for dynamically changing cell values

    Sir it is working ,i felt very happy....
    But unfortunately one thing happened.
    Say A1 = B1 + C1 ( B1,C1 are the cells of same sheet ) this is working
    but here my formulae for A1 = B1+ C1 ( where these cells are from other sheet /sometimes from other workbook also)
    help me over this
    TQ sir

  8. #8
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: Recording time for dynamically changing cell values

    try this

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: Recording time for dynamically changing cell values

    try this formula in B1 and copy down
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-02-2016
    Location
    mumbai,india
    MS-Off Ver
    2007
    Posts
    18

    Re: Recording time for dynamically changing cell values

    but what is happening ,what ever there is change in sheet or workbook time is changing,time to be recorded only for range (a1:a5)

  11. #11
    Forum Contributor Toonies's Avatar
    Join Date
    07-30-2009
    Location
    Newcastle, UK
    MS-Off Ver
    Excel 2016
    Posts
    503

    Re: Recording time for dynamically changing cell values

    can you post an example of you spreadsheet

    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  12. #12
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Recording time for dynamically changing cell values

    @ mahe1188, I hadn't realized that using 'Dependants' only works on the active sheet, so unfortunately this method cannot be used as required. I don't have any more suggestions at the moment sorry.

    @ Toonies
    I too initially suggested a Change Event code but that of course doesn't fire with formula changes which is what the OP wants. The Calculate Event cannot Target specific cells and the NOW() worksheet function will recalculate with every sheet calculation so is not a static time stamp.

  13. #13
    Registered User
    Join Date
    06-02-2016
    Location
    mumbai,india
    MS-Off Ver
    2007
    Posts
    18

    Re: Recording time for dynamically changing cell values

    Ayyoo......


    Anyway I am happy for your replies and active participation in solving problems.

    Thank you ....

    Let see some where I may get the solution for this

  14. #14
    Registered User
    Join Date
    06-02-2016
    Location
    mumbai,india
    MS-Off Ver
    2007
    Posts
    18

    Re: Recording time for dynamically changing cell values

    Private Sub Worksheet_Change(ByVal Target As Range)

    Dim rDependents As Range
    On Error Resume Next

    Set rDependents = Target.Dependents

    If Err.Number > 0 Then
    Exit Sub
    Else
    If Not Intersect(rDependents, Range("A1:A5")) Is Nothing Then
    rDependents.Offset(0, 1) = Time
    End If
    End If

    End Sub


    for the above code
    when cell is selected ,time is recording but time need to be recorded when cell values are changing .....can anyone help me over this

  15. #15
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: Recording time for dynamically changing cell values

    UDF :
    Please Login or Register  to view this content.
    Formula on B1 (and copied down) :
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  16. #16
    Forum Contributor Gregor y's Avatar
    Join Date
    10-24-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2010 32-Bit
    Posts
    276

    Re: Recording time for dynamically changing cell values

    Quote Originally Posted by mahe1188 View Post
    Sir it is working ,i felt very happy....
    But unfortunately one thing happened.
    Say A1 = B1 + C1 ( B1,C1 are the cells of same sheet ) this is working
    but here my formulae for A1 = B1+ C1 ( where these cells are from other sheet /sometimes from other workbook also)
    help me over this
    TQ sir
    karedog's code is probably the simplest solution to your exact phrasing of the problem; however there are probably a couple gotchas lurking in there that you may run into based you your quoted reply above...

    1. probably the lest likely to cause you a headache you specify only if the cell changes automatically, his code will update the time if it's done manually as well

    2. you specify when the value of A1(the calculated cell) changes, the code does this as requested; however this is similar to but not the same as when the values of the formula cells change especially when the formula cells are in another workbook. for example: Book1.Sheet1!A1=Book2.Sheet1!A1+Book2.Sheet2!A1 and Book1.Sheet1!B1='=TR(A1)', if Book1 is closed and you update the cells values in Book2 then the times in Book1 will not update till Book1 is calculated upon next open.

    3. Given the above situation if you wanted to push the times from Book2 to Book1 you could have the VBA code from DBY in Book2 open Book1 and do the push; unless Book1 is opened by a user other than yourself, then it's just not going to work.

    edit +1: I suppose you could also have the on_open on_close events of Book2 open and close Book1 in the background.

    edit +2: also Time() instead of Now() will give just the time.
    Last edited by Gregor y; 08-01-2016 at 06:33 PM. Reason: +2
    If it'd make you feel better using my answer because of my street cred, then you can go ahead and click Add Reputation below to improve it.

+ 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. Recording Changing Cell Values Adjacent to Cell
    By gandhiad in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-04-2015, 02:58 PM
  2. Replies: 0
    Last Post: 07-21-2006, 01:30 PM
  3. [SOLVED] Store values of a dynamically changing cell
    By Yogesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  4. [SOLVED] Store values of a dynamically changing cell
    By Yogesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  5. Store values of a dynamically changing cell
    By Yogesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  6. [SOLVED] Store values of a dynamically changing cell
    By Yogesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] Store values of a dynamically changing cell
    By Yogesh in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-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