I have a sheet called 2018, which tracks income, expenses by category, and taxes for that year.
I have a hidden sheet called tax report.
I have another hidden sheet called template, which is a template for the year sheet. When user closes out 2018, it will unhide the template, make a copy of it, change the copy's name to the new year (e.g. 2019), and rehide the template.
On the year sheet, when a user clicks on the button generate tax report, it will unhide the tax report and prompt user to print as pdf.
The tax report gives the total income for the year, the toral mileage for the year, and breakdowns the total expenses by category ( website, advertising, etc.)
When I crrated the tax report, the formulas refernce cells on sheet 2018. Many of them are named references.
However, when a user clicks on generate tax report on the 2019 sheet, the tax report opens up but will show the report for 2018. So I need the vba code that right now opens the unhidden tax report to also change all formula references on the tax report to the name of the sheet from which user clicked on the generate tax report button (the new year). The name of the year is in cell A1, so the vba code would just need to change the sheet name on every formula in the tax report to cell A1 on the sheet they clicked the button. (So if they clicked on generate tax report on sheet 2018, all formulas on the tax repoet sheet would referace 2018. If they clicked on generate tax report on sheet 2019, all formulas on the tax report sheet would reference sheet 2019, etc.)
This seems doable but then I don't know about the named references. (E.g. total category is one name, which refers to the category column in all 4 tables on the year sheet.)
I know how to use indirect to chage sheet reference for one formula, but I need all formulas on that tax report to change.
I have a hidden sheet called tax report.
I have another hidden sheet called template, which is a template for the year sheet. When user closes out 2018, it will unhide the template, make a copy of it, change the copy's name to the new year (e.g. 2019), and rehide the template.
On the year sheet, when a user clicks on the button generate tax report, it will unhide the tax report and prompt user to print as pdf.
The tax report gives the total income for the year, the toral mileage for the year, and breakdowns the total expenses by category ( website, advertising, etc.)
When I crrated the tax report, the formulas refernce cells on sheet 2018. Many of them are named references.
However, when a user clicks on generate tax report on the 2019 sheet, the tax report opens up but will show the report for 2018. So I need the vba code that right now opens the unhidden tax report to also change all formula references on the tax report to the name of the sheet from which user clicked on the generate tax report button (the new year). The name of the year is in cell A1, so the vba code would just need to change the sheet name on every formula in the tax report to cell A1 on the sheet they clicked the button. (So if they clicked on generate tax report on sheet 2018, all formulas on the tax repoet sheet would referace 2018. If they clicked on generate tax report on sheet 2019, all formulas on the tax report sheet would reference sheet 2019, etc.)
This seems doable but then I don't know about the named references. (E.g. total category is one name, which refers to the category column in all 4 tables on the year sheet.)
I know how to use indirect to chage sheet reference for one formula, but I need all formulas on that tax report to change.