Forum Discussion
If Statement that paste/freezes another cell
Thank you good sir.
Question, do I always have to run the macro or once it’s enabled & the file type is updated/saved, then as long as the first condition is met (date inserted in A1), the paste will happen automatically?
also, if I write the macro in tab 1, but duplicate the tab, will the macro now be enabled in tab 2 (copy of tab 1) or would I need to rewrite the macro in the tab 2?
thank you again Hans
The code is not a macro, but a so-called event procedure. Excel will execute it automatically each time you change the value of a cell in that worksheet. (but it will only do something when you enter a value in cell A1). You don't have to run it yourself (actually, you cannot run it since it is not a macro).
The code is stored with the worksheet, so if you duplicate the worksheet, the code will be duplicated to the copy, and run there automatically.
- GhulampopalOct 03, 2022Copper ContributorThank you Hans.
It worked perfectly, not a big deal, but any reason, when I delete the date, why the previous formula does not repopulate?- HansVogelaarOct 03, 2022MVP
- GhulampopalOct 03, 2022Copper ContributorIt was reference to another tab’s specific cell.
For example, tab ‘Gold Prices’’!A1 where a formula calculated Gold Price per Gram.
The code that replaced formula with a value, the formula was just a reference to the above.
Hope that was clear.