DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Any VBA experts?  (Read 4,566 times)

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Any VBA experts?
« on: February 22, 2019, 07:25 PM »
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, in any xls file I have opened?

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

Thanks!

Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,840
    • Coding Snacks
Re: Any VBA experts?
« Reply #1 on: February 24, 2019, 03:43 AM »
as usual, more info required...google is your friend

copying a sheet into a book is easy, but you may well have issues with the formulas (depending on what they are and what you're trying to do)

and it sounds like not everything in the formula sheet is applicable in every scenario you might use it in, so it may be that using the process you've described isn't a very efficient solution
Alcohol is photoshop, bottled
Askhole - someone who ask for advice, then ignores it
"Look wise, say nothing, and grunt. Speech was given to conceal thought" - Sir William Osler

kalos

  • Member
  • Joined in 2006
  • **
  • Posts: 1,824
Re: Any VBA experts?
« Reply #2 on: February 24, 2019, 04:45 PM »
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.

I don't think there is more info than that available.

Original address: https://www.donationcoder.com/forum/index.php?topic=47215.0