How to add a sheet with predifined text/formula in the active workbook?

excelos

Active Member
Joined
Sep 25, 2011
Messages
329
Hello

I have an Excel sheet with formulas and text in hundreds of cells.

Is there a way to click a button and add this sheet to the active workbook for any xls file that I may open?

Some formulas refer to a sheet with a specific name, so when this sheet is present in the workbook, the formulas must work.

Thanks!
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Coding4Fun

Active Member
Joined
Feb 16, 2017
Messages
360
You would need to tweak it to figure it into your situation but essentially this is to copy a sheet.

Let me know if it does not work or if I can help adjust further.

Code:
Sub Test()
ActiveSheet.Copy After:=Workbooks("Book1").Sheets(Sheets.Count)
End Sub
 

excelos

Active Member
Joined
Sep 25, 2011
Messages
329
I think this is nothing about what I asked.

I have a sheet with lots of formulas and text called TEMPLATESHEET. This sheet is stored in a TEMPLATEWORKBOOK.

When I open any xls file, I want a macro that will insert to the active workbook, the TEMPLATESHEET.

However, the TEMPLATESHEET, has some formulas that refer to a sheet called REFERENCESHEET.

So, when the xls file I open has a sheet with the same name, REFERENCESHEET, I want the formulas for the TEMPLATESHEET to link to the REFERENCESHEET.

Would that be possible? I may have to search-and-replace the #REF of the TEMPLATESHEET to match the REFERENCESHEET, unless the TEMPLATESHEET will preserve the references and have them working.
 

Watch MrExcel Video

Forum statistics

Threads
1,109,033
Messages
5,526,363
Members
409,697
Latest member
christopherlewis1620

This Week's Hot Topics

Top