+ Reply to Thread
Results 1 to 11 of 11

VBA help needed remembering previous values of a cell

  1. #1
    Registered User
    Join Date
    04-19-2023
    Location
    england
    MS-Off Ver
    2303
    Posts
    3

    VBA help needed remembering previous values of a cell

    Hi ive searched everywhere even tried these paid excel help sites but still no luck.
    i have live data coming into cell bj5 the values are constantly changing e.g 10....9...12....10...11 and so on
    how do i remember the previous 3 or 4 values of the cell and display them in say bk5 bk6 bk7 bk8 so i can use a formula to get the average value
    the values are only been displayed in bj5 though not above or blow it which seems to be an issue with these sites
    Many thanks hopefully someone smart out there can help...5 days of trying to figure this out

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,150

    Re: help needed remembering previous values of a cell

    You'll need VBA for that. If that's OK for you, I will move this thread to the VBA sub-forum.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    04-19-2023
    Location
    england
    MS-Off Ver
    2303
    Posts
    3

    Re: help needed remembering previous values of a cell

    yes thaats fine

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,444

    Re: VBA help needed remembering previous values of a cell

    Thread moved.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: VBA help needed remembering previous values of a cell

    So, in some way you will getting a value which is put into BJ5 but before that you want to keep 'actual value' in range.
    Let try something like this:


    Please Login or Register  to view this content.
    Check attached file.
    Attached Files Attached Files
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  6. #6
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA help needed remembering previous values of a cell

    Try this module in the sheet code. Every time the value changes, the old value will be recorded, and so on. To get the average, you'll only need to enter an average function in another cell, ie =AVERAGE(BK5:BK8)



    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-19-2023
    Location
    england
    MS-Off Ver
    2303
    Posts
    3

    Re: VBA help needed remembering previous values of a cell

    Thank you so so very much works great wow carnt thank you enough

  8. #8
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: VBA help needed remembering previous values of a cell

    @maniacb how would you ignore a change when the value has not actually changed
    example when editing cell BJ5 then not actually changing the value then pressing enter would trigger the change event
    how would you ignore that event?

  9. #9
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA help needed remembering previous values of a cell

    If you feel confident with VBA, One approach could be to turn off events with this code:

    Please Login or Register  to view this content.
    And then turn it back on with:

    Please Login or Register  to view this content.

  10. #10
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: VBA help needed remembering previous values of a cell

    Or:
    Please Login or Register  to view this content.
    because it means that last recorded value has not changed.

  11. #11
    Valued Forum Contributor
    Join Date
    12-01-2011
    Location
    Philippines
    MS-Off Ver
    Excel 2016
    Posts
    949

    Re: VBA help needed remembering previous values of a cell

    i see, thanks

+ 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. Incrementing numbers based on previous values and text values of a previous cell
    By mauricewsylvester in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-08-2021, 12:34 PM
  2. [SOLVED] Stop userform textbox from remembering previous entry
    By Nitefox in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 12-15-2013, 01:34 PM
  3. Remembering and using previous values
    By grant606 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-19-2007, 06:58 PM
  4. Userforms remembering values
    By wilro85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-05-2007, 06:45 PM
  5. remembering a previous score after updating
    By censura in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-20-2007, 03:12 AM
  6. Remembering Cell Values
    By Don in forum Excel General
    Replies: 2
    Last Post: 07-03-2006, 11:40 AM
  7. Remembering Data Values.
    By Workle in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-10-2005, 03:06 AM

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