Results 1 to 7 of 7

Need VBA formula that will link to same worksheet even if sheet name changes

Threaded View

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,408

    Need VBA formula that will link to same worksheet even if sheet name changes

    NOTE TO MODERATORS: I KNOW the Code element below is not in echelons. if I put them in. your SUCURI Firewall blocks the post! If someone can explain how to get round this I would be extremely grateful.

    Going round in circles here, so hope someone can help.

    User enters the number of worksheets to be created.
    Macro creates that number of sheets, and names each one as "(whatever) & i" (where i is the current number created).
    Macro then adds a column to the SUMMARY sheet for each new sheet created.
    Works perfectly

    Challenge: Each worksheet will be filled in, creating a series of subtotals.
    I need VBA to produce "formulae" on the SUMMARY sheet that link to the relevant worksheet and cell range automatically, even if the User change the sheet name at some point

    I tried setting each new sheet as "ws3" when it was created and used that in the "formulae" (e.g


    Range("C6").Select
    ActiveCell = "=" & sh3.Name & "!F6:F9"

    But every time the Code adds a new sheet, sh3 becomes the new "Active" sheet, which changed the formulae on all the previous columns.

    Any suggestions. pointers or alternatives welcome as ever.

    Ochimus
    Last edited by Ochimus; 09-18-2018 at 02:17 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Get the data from sheet 1 link to sheet 2 using formula
    By ALLANT in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-07-2016, 11:20 PM
  2. Replies: 0
    Last Post: 02-18-2016, 07:26 AM
  3. Formula to link cell on one sheet to changing cells on another sheet
    By Patish in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-18-2014, 12:55 PM
  4. Want to permanently Link cells on a new Worksheet to main sheet.
    By Fiddler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2014, 04:23 AM
  5. [SOLVED] How to put a formula in a link to another worksheet
    By ssiegel in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-10-2013, 12:45 PM
  6. macro that will automatically link a newly created worksheet to a summary sheet
    By liquidblack in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2009, 03:22 PM
  7. Copying a Formula which contains a link to another worksheet
    By Shirley Munro in forum Excel General
    Replies: 4
    Last Post: 02-03-2006, 05:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1