+ Reply to Thread
Results 1 to 9 of 9

any way to make copied paste links automatically udate to the current years spreadsheet

  1. #1
    Registered User
    Join Date
    04-19-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    any way to make copied paste links automatically udate to the current years spreadsheet

    I have a file containing multiple worksheets, each sheet representing data for a year and each having many paste links from other sheets. All sheets have a name reflective of the year, eg. aaa2016, aaa2017 etc

    At the beginning of each year, a new identical sheet is created (copied from the previous year), so next year's would be aaa2017. And the paste links come from sheets in different files named bbb2016, bbb2017 etc.

    The problem is that all the paste links in any new sheet (copied from the previous year) will still refer to sheets from the previous year and so at the moment I update them all manually. The only thing that needs changing in these links is the last digit at the end of the name (ie. from aaa2016 to aaa2017 etc) because all cell locations remain identical.

    So the question is, how can I make the paste links automatically update - ie. effectively increase the last digit in the name by 1 digit, so that a link to cell 'aaa2016'!B2 becomes a link to 'aaa2017'!B2 etc.

    Does anyone know how to make that happen automatically?

    Thanks

  2. #2
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    You can do it all in one hit
    Use search and replace, replacing all

    replace:
    'aaa2016'!
    with:
    'aaa2017'!
    If a response has helped then please consider rating it by clicking on *Add Reputation below the post
    When your issue has been resolved don't forget to mark the thread SOLVED (click Thread Tools at top of thread)

  3. #3
    Registered User
    Join Date
    04-19-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    Thanks for your reply.
    Yes I've sometimes done it that way, replacing multiple links at a time. There are lots of different links so quite a few variations have to be done. It's definitely better than doing each one individually but I was hoping that there might be some kind of way that they can all be made to update automatically without manual intervention.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    Hi, welcome to the forum

    1st, are you saying that you have each ear's data on a new sheet? If so, have you considered using 1 sheet for ALL data, then just referencing that instead?

    If that is not an option, maybe you could use INDIRECT() to add teh year to a formula, but that can become resource-heavy if used extensively

    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    04-19-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    Hi and thanks.

    Imagine 10 excel files containing a worksheet for each year. So if we just limit discussion to the past 10 years, that's 100 sheets. eg.

    aaa2007, aaa2008 ....> aaa2016

    bbb2007, bbb2008 ....> bbb2016

    through to

    jjj2007, jjj2008 ....> jjj2016


    Now from these sheets there is another separate excel file that takes data from all the sheets of a particular year. This file's sheets also follow the naming pattern of ___2007, ___2008 ....> ___2016.

    So the question is, when the new sheet ___2017 is created (by initially simply making a copy of ___2016), is there some way to make all the links in the new ___2017 automatically update, so instead of referring to aaa2016, bbb2016 through to jjj2016, they would now refer to aaa2017, bbb2017 through to jjj2017.

    Does that explain it better?

  6. #6
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    Select multiple sheets and replace just the tail as follows:

    replace:
    2016'!
    with:
    2017'!

  7. #7
    Registered User
    Join Date
    04-19-2016
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    yes Kevin I agree it's a good way to do the changes more efficiently. It still takes a few runs because the names are not as simple as the ones I've used in the simplified example above. But what would really be ideal is if there was some instruction or function that could be put in each relevant cell so that the links would always update automatically upon the creation of the new sheet.

  8. #8
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    We are all guilty at times of not planning workbooks properly or we adapt them later and use them in ways we never intended originally. It is the little inconsistencies that cause such problems when we want to make adjustments that sound so simple.

    How about amending your worksheet names so that they ALL end with a consistent last few characters??
    Your formulas would all re-reference automatically. My previous suggestion would work.
    But BEWARE - it would cause you a few (many??) headaches if the file contains macros - they will not automatically re-reference!

    An alternative would be to create a macro to do the work instead.
    But then you need to write out exactly what needs to be replaced by what.
    And BEWARE if the text strings do not contain any special characters, then it is possible to inadvertently replace something you do not want to replace.
    I would suggest making the macro write a "table of replacements" to a worksheet for checking first!

    My preference (unless there are macros!) would be to re-name worksheets to make them consistent and keep things simple

  9. #9
    Valued Forum Contributor
    Join Date
    01-03-2016
    Location
    Conwy, Wales
    MS-Off Ver
    2016
    Posts
    974

    Re: any way to make copied paste links automatically udate to the current years spreadshee

    Hi MavEx
    In response to your PM:

    The reference within any workbook would be automatically re-referenced correctly within that workbook whenever you amend a sheet name within that workbook.
    However any external links would need modifying separately if a lower level workbook's sheet was renamed. And, using "search and replace",t could be easily achieved globally by macro.
    eg
    to amend this link
    ='D:\Documents\ABC\[FileName.xlsx]2013XX'!$B$5
    to
    ='D:\Documents\ABC\[FileName.xlsx]YY2013'!$B$5

    Loop through the workbook and
    replace this string
    [FileName.xlsx]2013XX'!
    with this string
    [FileName.xlsx]YY2013'!

    It's a bit difficult to comment when I cannot see what's involved.

    But in principle it would be possible to write a macro that

    1. loops through all the lower level workbooks in a single folder and amend sheet names based on a table (if name = X, rename it Y) - I would expect everything to still function correctly in those workbooks
    2. loops through all sheets in Top Level workbook containing the links and "search and replace" those links based on the same table

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automatically add new rows with updated years in spreadsheet?
    By C.j. in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-01-2015, 10:43 AM
  2. Replies: 1
    Last Post: 05-16-2013, 02:15 AM
  3. Replies: 2
    Last Post: 06-22-2012, 12:18 PM
  4. paste copied cell by inserting row automatically
    By parajf in forum Excel General
    Replies: 1
    Last Post: 01-31-2011, 05:23 PM
  5. Replies: 3
    Last Post: 08-03-2006, 03:15 PM
  6. Paste Links not updating automatically.
    By Debbie H in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-14-2006, 11:20 AM
  7. automatically open a spreadsheet for the current day's entry
    By walkontheweb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-05-2005, 03:05 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