0

The range "C2": "C82" contains functions of type (='Sheet4'!G38) , (='Sheet6'!G36), (='Sheet5'!G18), etc, that is to say, the cells of this Column C obtain values ​​of calculations that are established in other cells of other sheets. My workbook is constantly refreshed and all its values ​​too. With the help of VBA I would like to remember the previous value that existed in each cell of that column and constantly display it in another column, for example "J2": "J82" every time a refresh occurs. I clarify that what you want to remember are not values ​​entered manually but automatically and that they are funtions. There is a lot of information on the internet, but none has helped me because they only work if the values ​​are manually entered. If they could post the correct VBA it would be very helpful. Note: When I refer to remembering it is because in my Spanish language it is the word that is closest to what I want, in English I think it could also be: obtain, save, record. Most of the VBA codes I have tried contain: Private Sub Worksheet_Change. Apparently this parameter only detects if something changes, it does not detect when a calculation is made or when a function changes.

iPerry
  • 13
  • 3
  • `Worksheet_Calculate` is what you need if you're dealing with formulas. – BigBen May 15 '20 at 18:36
  • I don't know much about VBA and I don't know how to get the previous value of the result of a function in the same cell, could you help me in the elaboration? – iPerry May 15 '20 at 18:39
  • 1
    You can't get the previous value from a cell with a formula, but you can store the *initial* value in a range or Global / Static variable, so you can check it on the *next* calculation event. If you want to store the values in a range you can do something like this on each `Calculate` event: `Range("J2:J82").Value = Range("C2:C82").Value` – Tim Williams May 15 '20 at 18:42
  • How would the VBA code be to remember the previous value of a function? – iPerry May 17 '20 at 21:55

0 Answers0