Forum Discussion
Save / Restore all formulas on a worksheet
- Aug 16, 2022
The macro writes one formula in 10000 cells in this example. In cell I2 the formula =B2*C2 is entered, in cell I3 formula =B3*C3 and so on. If any changes are made in column I the formulas can be re-entered by running the macro. I wanted to show that the original formulas can be re-entered in almost no time with the help of a macro.
Can you share the formulas of your sheet? Maybe the formulas can be written into the file with the R1C1 code.
I solved something like that in a very unorthodox way. But this is probably only suitable for worksheets where there are not so many formulas. If you overwrite a formula with a value and later prefer to restore the formula.
I wrote the formula in the selection for the dropdown and did not restrict the values to those from the dropdown. You can also write your formula in the name editor and then only call up the name in the dropdown. This keeps the formula dynamic if you need it in several places in the worksheet.
I have made a very small example document. Maybe this will give you a useful idea outside of VBA. But the code is certainly great!
I would like to thank everyone for the help with this issue. Leadership has dropped this request and we are moving on to other projects.
I think the best option I found for my needs was creating a backup of the worksheet in another hidden tab, and making a macro to delete this sheet, and then copy, and rename the backup sheet, and then changing a few variable fields to make the filters work correctly. If I run into this again in the future I will try that.
Thanks again!