+ Reply to Thread
Results 1 to 5 of 5

Referring to a workbook with constantly changing name and date

  1. #1
    Registered User
    Join Date
    03-24-2017
    Location
    Moscow
    MS-Off Ver
    2016
    Posts
    2

    Referring to a workbook with constantly changing name and date

    Hi, everybody!

    I have a formula that contains reference to a table in another workbook.
    The problem is that the other workbook is replaced every week with a new version. The table's format remains the same but the data and the file name changes in every new version.

    The file name changes in the following manner - "New Table 09.03.2017" to "New Table 16.03.2017"

    So I need to either write a macros that either:

    1) refers to a table in the most recent workbook (with the latest date modified)

    or

    2) refers to a table with the newest date in the file name

    How can I write a macros for this?


    Thanks in advance!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Referring to a workbook with constantly changing name and date

    I would recommend you link your formulas to a NON-dated version of the file, NewTable.xlsx.

    Then maybe a macro that searches a given folder, finds the most recent one using whatever logic you deign, and once that is settled upon, makes a copy of that file to replace the NewTable.xlsx
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    03-24-2017
    Location
    Moscow
    MS-Off Ver
    2016
    Posts
    2

    Re: Referring to a workbook with constantly changing name and date

    Quote Originally Posted by JBeaucaire View Post
    NewTable.xlsx.

    Then maybe a macro that searches a given folder, finds the most recent one using whatever logic you deign, and once that is settled upon, makes a copy of that file to replace the NewTable.xlsx
    I see. Is there a ready macros that finds the most recent file in the excel folder?

  4. #4
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Referring to a workbook with constantly changing name and date

    Hi sarbasvovn

    I always just rename the latest file to the "Master Name" in my code.
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  5. #5
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    14,958

    Re: Referring to a workbook with constantly changing name and date

    Quote Originally Posted by sarbasvovn View Post
    I see. Is there a ready macros that finds the most recent file in the excel folder?
    Here is some code I found that might get you started
    Please Login or Register  to view this content.
    Last edited by Sintek; 03-24-2017 at 05:31 AM.

+ 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. Numbers constantly changing to Dates
    By excelsoft in forum Excel General
    Replies: 8
    Last Post: 06-03-2015, 01:23 PM
  2. Variable that is constantly changing
    By coys1717 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-12-2014, 11:39 AM
  3. Replies: 1
    Last Post: 08-17-2013, 01:05 AM
  4. [SOLVED] Trying to SUM a constantly changing schedule.
    By josebaptista in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-17-2013, 06:49 AM
  5. [SOLVED] Link formula referring to other workbook keeps changing.
    By leaning in forum Excel General
    Replies: 14
    Last Post: 06-07-2013, 03:15 AM
  6. Web Query Help:changing constantly.
    By Rubbadub in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-25-2008, 02:48 PM
  7. Replies: 0
    Last Post: 02-24-2005, 06:00 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