Forum Discussion
Save Previous Cell Value Of A Changed Cell In Excel
thank you very much for the help! I have tried the fix you suggested of changing the incorrect code to :
xDCell.Formula = xDic.Items(I).Value
however the code will now not produce the previous cell anymore. no errors were given, but the code does not produce anything. any suggestions?
Shelbie1288 I think that should be:
xDCell.Value = xDic.Items(I).Value
- SrilahariOct 04, 2022Copper Contributorhave entered the code in view code but when the data is refreshing in C:C, F:F, L:L columns it's not saving in the prescribed column.
Data is refreshing from web site .- mtarlerOct 07, 2022Silver Contributordoes it work at all? basically first I need to know if the issue is that the code doesn't work for you at all or if it a refresh issue. If the data is updated in the background and not triggering a worksheet_change event that could be a problem or maybe you added the code to a 'module' instead of the actual worksheet. It is hard to know without the workbook.
- Shelbie1288Oct 26, 2020Copper Contributor
Thank you for the reply! when I do that, it forces the cell that should contain the previous value to be blank. The code is not working and if I try to type something into that value it makes it blank. any suggestions? Thanks again!
- mtarlerOct 26, 2020Silver Contributor
Shelbie1288 OK so I actually looked at the code and I think I know what is going on. I don't have Dictionary type in my Excel (maybe this was an add-in or defined in another sheet of you book) but I think I get it. Try returning that line back to the original:
xDCell.Value = xDic.Items(I)
and down much lower change this line:
xDic.Add xRgArea(J).Address, xRgArea(J).Formula
to
xDic.Add xRgArea(J).Address, xRgArea(J).Value
crossing my fingers ...
- Shelbie1288Oct 26, 2020Copper Contributor
OH MY GOSH IT WORKED!!!!! I love you so much thank you thank you!!!!!!!
I do have one more tiiiiny question if you do not mind since you are an Excel Wizard!
So I am doing this with columns G and D, if I wanted to this for columns L and H simultaneously as well....how would one go about that? Then I promise I will not ask any more questions!!! Again I cannot thank all of you enough for the help!!!!