topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday October 4, 2024, 5:58 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Any VBA experts?  (Read 2890 times)

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Any VBA experts?
« on: February 22, 2019, 01: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,832
    • View Profile
    • Donate to Member
Re: Any VBA experts?
« Reply #1 on: February 23, 2019, 09:43 PM »
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

kalos

  • Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 1,824
    • View Profile
    • Donate to Member
Re: Any VBA experts?
« Reply #2 on: February 24, 2019, 10:45 AM »
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.