Save Previous Cell Value Of A Changed Cell In Excel

%3CLINGO-SUB%20id%3D%22lingo-sub-2838339%22%20slang%3D%22en-US%22%3ESave%20Previous%20Cell%20Value%20Of%20A%20Changed%20Cell%20In%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2838339%22%20slang%3D%22en-US%22%3E%3CP%3EI%20don't%20know%20English%20enough%2C%20but%20I%20will%20try%20to%20write%20quite%20good%3CBR%20%2F%3EI%20wrote%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%20in%20comments%20for%20the%20same%20topics.%26nbsp%3B%3CBR%20%2F%3EI%20use%20Excel%202019%3CBR%20%2F%3EI%20need%20a%20macro%20for%20my%20job%20files.%3CBR%20%2F%3E%3CBR%20%2F%3EThere%20is%20Excel%20book(For%20example%3A%20PLAN)%3CBR%20%2F%3EThere%20is%20second%20Excel%20book(TV)%3CBR%20%2F%3E%3CBR%20%2F%3EIn%20PLAN%20there%20is%20a%20cell(B5)%2C%20and%20it%20contains%20formula%2C%20every%20day%20a%20cell%20will%20be%20change.%3CBR%20%2F%3E%3CSPAN%3EI%20want%20to%20save%2014%20meanings%20in%20TV(and%20also%20I%20want%20to%20have%20opportunity%20in%20macros%20to%20change%20it%2C%20for%20example%2030%20meanings).%20One%20day-one%20meaning%2C%20and%20after%2014%20days%20I%20want%20to%20macros%20deletes%20last%20meaning.%20It%20likes%20history%20of%20happening.%20It%20likes%20a%20calendar%20of%20happenings%2C%20and%20I%20can%20change%20number%20of%20days.%26nbsp%3B%3CBR%20%2F%3E%3C%2FSPAN%3EIn%20TV%20I%20want%20to%20have%20opportunity%20change%20row%2C%20which%20I%20need.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EFor%20examle%3A%20If%2029.09.2021%20is%20last%20day(for%20example%2014th%20days)%20and%20tomorrow%20I%20want%20to%20delete%2029.09.2021%20and%20Last%20day%20will%20be%2030.09.2021.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%3EAnd%20if%20even%20today%20my%20cell%20is%20equal%20to%20yesterday%20cell%20I%20also%20want%20to%20save%20it%20in%20my%20history%20list.%3CBR%20%2F%3E%3C%2FSPAN%3EAlso%20I%20want%20to%20macros%20can%20update%20data%20automatically%20from%20PLAN.%3CBR%20%2F%3EI%20attached%202%20files%20Excel.%3CBR%20%2F%3EI%20do%20hope%20you%20understand%20me))%3CBR%20%2F%3E%3CSPAN%3EHow%20can%20I%20make%20it%3F%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2838339%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2841703%22%20slang%3D%22en-US%22%3ERe%3A%20Save%20Previous%20Cell%20Value%20Of%20A%20Changed%20Cell%20In%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2841703%22%20slang%3D%22en-US%22%3Ecan%20i%20ask%20you%20why%20you%20want%20to%20delete%20the%20older%20values%2Fdates%20instead%20of%20just%20ignoring%20them%3F%3CBR%20%2F%3EMy%20experience%20is%20that%20historical%20records%20can%20be%20very%20helpful%20to%20explain%20and%20or%20show%20proof%20later%20on.%3CBR%20%2F%3EWhy%20not%20have%20a%20running%20list%20and%20on%20another%20sheet%20just%20present%20the%20latest%2030%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2841745%22%20slang%3D%22en-US%22%3ERe%3A%20Save%20Previous%20Cell%20Value%20Of%20A%20Changed%20Cell%20In%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2841745%22%20slang%3D%22en-US%22%3EIt%20sounds%20interesting%2C%20and%20I%20think%20I%20don't%20mind%20this...%3CBR%20%2F%3EBut%20I%20want%20to%20change%20meanings(Now%20I%20want%2030%20meanings%2C%20next%20month%20I%20want%20to%20see%2014%20meanings%20etc.)%3CBR%20%2F%3EIf%20you%20can%20make%20it%2C%20I%20will%20be%20excited%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2841875%22%20slang%3D%22en-US%22%3ERe%3A%20Save%20Previous%20Cell%20Value%20Of%20A%20Changed%20Cell%20In%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2841875%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1183266%22%20target%3D%22_blank%22%3E%40Maksim757040%3C%2FA%3E%26nbsp%3B%20i%20still%20don't%20know%20what%20you%20really%20need%20but%20here%20is%20an%20example%20of%20what%20I%20mean.%3C%2FP%3E%3CP%3EIn%20the%201st%20sheet%20is%20a%20data%20entry%20table%20with%20date%20(you%20can%20enter%20today's%20date%20by%20holding%20CTRL%20and%20typing%20%3B%20).%26nbsp%3B%20Then%20maybe%20a%20couple%20columns%20of%20data%20(e.g.%20units%20sold%2C%20price%2Funit)%20then%20a%20column%20that%20has%20a%20formula%20to%20give%20you%20that%20final%20value%20you%20are%20interested%20in.%3C%2FP%3E%3CP%3EOn%20the%202nd%20sheet%20I%20have%20an%20input%20cell%20to%20easily%20change%20how%20many%20you%20want%20to%20view%20the%20last%20X%20number%20from%20the%20previous%20sheet).%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2842024%22%20slang%3D%22en-US%22%3ERe%3A%20Save%20Previous%20Cell%20Value%20Of%20A%20Changed%20Cell%20In%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2842024%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3BI%20explain%2C%3CBR%20%2F%3EI%20work%20in%20a%20construction%20company.%20For%20example%20there%20is%20one%20work%20-%20Pile%20driving.%20Every%20day%20on%20a%20construction%20site%20workers%20drive%20piles%20and%201st%20day%20they%20drive%205%20piles%2C%202nd%20day%20they%20drive%2010%20piles%20and%20etc.%20After%20I%20compare%20the%20actual%20work%20with%20the%20plan%20and%20change%20the%20percentage%20(percentage%20of%20completion)%20every%20day.%20the%20percentage%20-%20this%20is%20a%20formula%20and%20it%20changes%20automatically.%20And%20I%20want%20to%20save%20every%20the%20percentage%20every%20day.%20I%20want%20to%20save%20every%20day%20and%20meanings%20into%20my%20calendar.%3CBR%20%2F%3EAnd%20sometimes%20I%20want%20to%20see%20history%20of%2030%20days%2C%20sometimes%20history%20of%2014%20days.%3CBR%20%2F%3EAnd%20I%20want%20to%20date%20changes%20automatically%20every%20day(because%20it's%20a%20formula%20%3DNOW())%3CBR%20%2F%3EFor%20example%3CBR%20%2F%3EToday%2013.10.2021(A1)%20-%205%20piles(B1).%20Tomorrow%20I%20want%20to%20see%20new%20date%20in%20A2%20-%2014.10.2021%20and%20new%20B2%20-%206%20piles.%20This%20is%20a%20history%20of%202%20days.%20In%20B1%2C%20B2%20...%20etc.%20there%20is%20formula%20and%20meanings%20update%20automatically%20from%20other%20files%20Excel.%20But%20the%20range%20is%20limited%20because%20the%20column%20E2(for%20example)%20contains%20today's%20value.%20And%20we%20have%20for%20example%20range%20between%20A2%20and%20E2%20(5%20columns-5days).%20E2%20should%20be%20always%26nbsp%3Btoday's%20value.%26nbsp%3BIf%20columns%20A2-E2%20contain%20the%20value%20of%20the%20latest%20dates%2C%20then%20tomorrow%20I%20want%20to%20see%20E2%20%3D%20dates%20tomorrow%2C%20D2%20%3D%20dates%20today%2C%20C2%20%3D%20dates%20yesterday%20and%20values%20for%20each%20date%2C%20respectively%3CBR%20%2F%3EAnd%20I%20want%20to%20change%20value%20of%20history's%20days(30days%20or%20maybe%2014days).%3CBR%20%2F%3EExcel%20book%20TV%20should%20show%20history%20of%20days%2C%20but%20meanings%20should%20update%20from%20Excel%20book%20PLAN.%3CBR%20%2F%3EAnd%20if%20now%20day%20comes%20I%20want%20to%20Excel%20make%20a%20new%20columns%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2843058%22%20slang%3D%22en-US%22%3ERe%3A%20Save%20Previous%20Cell%20Value%20Of%20A%20Changed%20Cell%20In%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2843058%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1183266%22%20target%3D%22_blank%22%3E%40Maksim757040%3C%2FA%3E%26nbsp%3B%20So%20I%20renamed%20a%20couple%20columns%20and%20the%20second%20sheet%20and%20also%20transposed%20the%20data%20on%20the%20second%20sheet%20(%22TV%22)%20so%20it%20is%20horizontal.%26nbsp%3B%20conceptually%20it%20is%20all%20the%20same%20but%20maybe%20closer%20to%20what%20you%20need%3F%26nbsp%3B%20As%20for%20%22automatically%22%20creating%20the%20date%2C%20I%20recommend%20just%20having%20them%20hit%20CTRL%20%3B%20to%20insert%20todays%20date%20but%20it%20could%20be%20done%20using%20a%20circular%20reference%20and%20change%20the%20sheet%20settings%20or%20using%20a%20macro%20(but%20then%20we%20need%20to%20change%20the%20file%20to%20xlsm%20and%20permit%20macros).%3C%2FP%3E%3CP%3Esee%20if%20the%20attached%20is%20close.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2844529%22%20slang%3D%22en-US%22%3ERe%3A%20Save%20Previous%20Cell%20Value%20Of%20A%20Changed%20Cell%20In%20Excel%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2844529%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3EIt's%20close%20to%20what%20I%20want%2C%20but%20yes%2C%20I%20want%20to%20use%20macros%20for%20automatically%20processes%20to%20create%20the%20new%20date.%3CBR%20%2F%3EI%20created%20the%20sheet%20%22DATE%22%20where%20there%20are%20my%20today's%20date%20and%20info.%3CBR%20%2F%3EThis%20meanings%20sholud%20be%20only%20in%20their%20own%20cell.%20NOW(A1)%2C%20Info(A5).%3CBR%20%2F%3EOkey%2C%20next%20step%3A%20there%20is%20sheet%20%22History%22.%20I%20don't%20mind%20this%20sheet%2C%20it's%20great%20to%20save%20my%20history.%20I%20understood%20and%20accepted%20your%20advice.%20But%20I%20want%20to%20in%20%22History%22%20automatically%20updated%20new%20date%20and%20info%20from%20%22DATE%22.%20For%20example%3A%20A2%3DDATE!A1%20and%20D2%3DDATE!A4%20(This%20is%20my%20data%20from%20which%20automatically%20save)%20and%20this%20data%20goes%20from%20up%20to%20down.%20It%20means%20that%20A2%20always%20is%20today's%20date%20and%20D2%20always%20is%20today's%20info(This%20update%20happens%20automatically%20from%20the%20%22DATE%22%20sheet%2C%20tomorrow%20it%20will%20be%20one%20line%20lower%20(A3%20and%20D3%2C%20respectively))%3CBR%20%2F%3EAnd%20finally%20step%3A%3CBR%20%2F%3EI%20want%20to%20see%20on%20sheet%20%22TV%22%20next%3A%20the%20date%20and%20info%20of%20the%20work%20must%20be%20horizontally%20located.%20Today's%20date%20and%20info%20have%20to%20be%20in%20last%20column(for%20example%20it%20can%20be%20K)%20and%20previous%20dates%20and%20info%20have%20to%20go%20from%20right%20to%20left.%20And%20also%20there%20is%20one%20moment%2C%20that%20column%20(which%20is%20to%20the%20righ%2C%20for%20example%20L)%20will%20be%20contained%20other%20info%2C%20which%20don't%20connect%20with%20info%20in%20range%20from%20K%20to%20A.%26nbsp%3B%3CBR%20%2F%3EAlso%20I%20want%20to%20be%20able%20to%20change%20number%20of%20days%20which%20I%20want%20to%20show%20and%20it%20should%20be%20happened%20next%3A%20I%20input%20number%20of%20days%2C%20which%20I%20want%20to%20show%20and%20Excel%20hides%20days%20and%20info%2C%20which%20don't%20fall%20into%20the%20desired%20range%20(info%20in%20this%20range%20has%20to%20disappear(and%20doesn't%20show%20error)%20or%20columns%20must%20be%20removed)%3CBR%20%2F%3EI'm%20sure%20I%20need%20macros%20because%20there%20are%20processes%20that%20should%20run%20automatically.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I don't know English enough, but I will try to write quite good
I wrote @mtarler  in comments for the same topics. 
I use Excel 2019
I need a macro for my job files.

There is Excel book(For example: PLAN)
There is second Excel book(TV)

In PLAN there is a cell(B5), and it contains formula, every day a cell will be change.
I want to save 14 meanings in TV(and also I want to have opportunity in macros to change it, for example 30 meanings). One day-one meaning, and after 14 days I want to macros deletes last meaning. It likes history of happening. It likes a calendar of happenings, and I can change number of days. 
In TV I want to have opportunity change row, which I need.


For examle: If 29.09.2021 is last day(for example 14th days) and tomorrow I want to delete 29.09.2021 and Last day will be 30.09.2021.

And if even today my cell is equal to yesterday cell I also want to save it in my history list.
Also I want to macros can update data automatically from PLAN.
I attached 2 files Excel.
I do hope you understand me))
How can I make it?

11 Replies
can i ask you why you want to delete the older values/dates instead of just ignoring them?
My experience is that historical records can be very helpful to explain and or show proof later on.
Why not have a running list and on another sheet just present the latest 30?
It sounds interesting, and I think I don't mind this...
But I want to change meanings(Now I want 30 meanings, next month I want to see 14 meanings etc.)
If you can make it, I will be excited

@Maksim757040  i still don't know what you really need but here is an example of what I mean.

In the 1st sheet is a data entry table with date (you can enter today's date by holding CTRL and typing ; ).  Then maybe a couple columns of data (e.g. units sold, price/unit) then a column that has a formula to give you that final value you are interested in.

On the 2nd sheet I have an input cell to easily change how many you want to view the last X number from the previous sheet).  

@mtarler I explain,
I work in a construction company. For example there is one work - Pile driving. Every day on a construction site workers drive piles and 1st day they drive 5 piles, 2nd day they drive 10 piles and etc. After I compare the actual work with the plan and change the percentage (percentage of completion) every day. the percentage - this is a formula and it changes automatically. And I want to save every the percentage every day. I want to save every day and meanings into my calendar.
And sometimes I want to see history of 30 days, sometimes history of 14 days.
And I want to date changes automatically every day(because it's a formula =NOW())
For example
Today 13.10.2021(A1) - 5 piles(B1). Tomorrow I want to see new date in A2 - 14.10.2021 and new B2 - 6 piles. This is a history of 2 days. In B1, B2 ... etc. there is formula and meanings update automatically from other files Excel. But the range is limited because the column E2(for example) contains today's value. And we have for example range between A2 and E2 (5 columns-5days). E2 should be always today's value. If columns A2-E2 contain the value of the latest dates, then tomorrow I want to see E2 = dates tomorrow, D2 = dates today, C2 = dates yesterday and values for each date, respectively
And I want to change value of history's days(30days or maybe 14days).
Excel book TV should show history of days, but meanings should update from Excel book PLAN.
And if now day comes I want to Excel make a new columns


@Maksim757040  So I renamed a couple columns and the second sheet and also transposed the data on the second sheet ("TV") so it is horizontal.  conceptually it is all the same but maybe closer to what you need?  As for "automatically" creating the date, I recommend just having them hit CTRL ; to insert todays date but it could be done using a circular reference and change the sheet settings or using a macro (but then we need to change the file to xlsm and permit macros).

see if the attached is close.

@mtarler 
It's close to what I want, but yes, I want to use macros for automatically processes to create the new date.
I created the sheet "DATE" where there are my today's date and info.
This meanings sholud be only in their own cell. NOW(A1), Info(A5).
Okey, next step: there is sheet "History". I don't mind this sheet, it's great to save my history. I understood and accepted your advice. But I want to in "History" automatically updated new date and info from "DATE". For example: A2=DATE!A1 and D2=DATE!A4 (This is my data from which automatically save) and this data goes from up to down. It means that A2 always is today's date and D2 always is today's info(This update happens automatically from the "DATE" sheet, tomorrow it will be one line lower (A3 and D3, respectively))
And finally step:
I want to see on sheet "TV" next: the date and info of the work must be horizontally located. Today's date and info have to be in last column(for example it can be K) and previous dates and info have to go from right to left. And also there is one moment, that column (which is to the righ, for example L) will be contained other info, which don't connect with info in range from K to A. 
Also I want to be able to change number of days which I want to show and it should be happened next: I input number of days, which I want to show and Excel hides days and info, which don't fall into the desired range (info in this range has to disappear(and doesn't show error) or columns must be removed)
I'm sure I need macros because there are processes that should run automatically.

@Maksim7570  i think the attached does everything you want.  i added a button to "ADD DATA" because if I made it automatic on update then every time someone made a mistake they have to go into the history page and delete that row.  They still do if they make a mistake but at least they have to actually hit the button before it adds that data.

You say you need the macro because things are done automatically but that isn't true at all.  The ONLY thing this macro is doing is copying the data into the table on the history sheet.  The creation of the table on the TV page including the automatic update of that table based on the # of day you want to show is all done by the sheet formulas.

@mtarler 
Your decision with the button looks great, but I have one problem)
My Excel doesn't recognize these formulas and maybe there are other decisions? other function or macro?

Maksim7570_1-1634284949177.png

 

 

@Maksim7570  I'm sorry, you did say you have Excel 2019.  see attached:

I created formulas for 30 columns to see up to 30 days but you could fill right for more if needed.

That said, in  previous post you said you wanted another value to the right of those cells and you said for example the data is in A:K and you would have something in L but that would have to be in AF or so to have up to 30 columns available for the data. Or incorporate that cell information as an alternative formula/data in the formula I created based on it being X columns more than then total requested...

 

You are the genius! I'm so excited! You solved my problems and did my work life better Thank you very much!
it works very good.Earlier I thought my problems could solve only macros, but you used one macro, You are the best man!)