I have been looking for a VBA subroutine to add it into a "main routine." My program will always have three sheets: the "start" sheet (permanent sheet), "a," and "b" or "x" and "z" (only two scenarios). What I want to accomplish is this:
1. The main VBA routine is running, then
2. If sheet "a" exists, then insert in sheet "b," cell $D$1, a formula that refers to the "start" sheet (=start!$F$1).
3. If "a" does not exist but "x" exists, then insert in sheet "z," cell $D$1, a formula that refers to the start sheet (=start!$F$2).
4. Do nothing if sheets "a" and "x" do not exist.
4. Then, continue running and finishing the main routine.
Thank you for your help!
1. The main VBA routine is running, then
2. If sheet "a" exists, then insert in sheet "b," cell $D$1, a formula that refers to the "start" sheet (=start!$F$1).
3. If "a" does not exist but "x" exists, then insert in sheet "z," cell $D$1, a formula that refers to the start sheet (=start!$F$2).
4. Do nothing if sheets "a" and "x" do not exist.
4. Then, continue running and finishing the main routine.
Thank you for your help!