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

excelos

Well-known Member
Joined
Sep 25, 2011
Messages
591
Office Version
  1. 365
Platform
  1. Windows
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!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top