+ Reply to Thread
Results 1 to 9 of 9

Storing previous value in cell when data is changed

  1. #1
    Registered User
    Join Date
    07-16-2008
    Location
    TO
    Posts
    18

    Storing previous value in cell when data is changed

    Hi,

    I have a value in A1 that continuously changes. However, after A1 has changed, I need the previous value in A1 to appear in A2 and when A1 changes again, I again need the previous value to appear in A2 and so on.

    For example, if A1=1 and it changes to A1=2, then I need A2=1. Then, if A1=3, I need A2=2, etc.

    I simply need the previous value in a particular cell to be stored in another cell. If somebody can help me with this problem it would be greatly appreciated.

  2. #2
    Registered User
    Join Date
    08-10-2007
    Posts
    51
    Can I build the function by storing the previous value someplace on the worksheet or in another hidden worksheet? The problem is that I can't save the value in the memory after the function stops.

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    It changes because you're changing it, or as a result of a formula, or something else?

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    07-16-2008
    Location
    TO
    Posts
    18
    what really happens is E53 is a user-entered value. then, because of that value, E56 changes due to the formula written in E56. Now after I change E53 to another value, I need the previous value of E56 to be stored in P56. SO i need the previous value of E56 to be stored in P56 (again E56 changes as the user-entered E53 changes). Any ideas? Any help would be greatly appreciated. I really have no idea how to use VBA =(

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Have you at least tried the example code to see if it is anyhing like what you wan/ You should really only need to change the cell references.

  7. #7
    Registered User
    Join Date
    07-16-2008
    Location
    TO
    Posts
    18
    so my code should just be:

    Please Login or Register  to view this content.
    ??

    because I tried that and it didn't work. Also Where should i put this on the code sheet? can i just put it right at the top of my sheet (this macro has nothing to do with any of the other macros on this sheet).
    Last edited by VBA Noob; 07-18-2008 at 01:47 PM.

  8. #8
    Registered User
    Join Date
    07-16-2008
    Location
    TO
    Posts
    18
    thanks. i believe it actually is working. however when E56 changes, the adjacent cell is the previous value of E56 for only a few seconds and then it changes to the current value of E56. I'm unsure why this is. if you could help that would be great. Thanks for all the help already.

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Can you attach your workbook?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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