+ Reply to Thread
Results 1 to 5 of 5

Variable Workbook name

  1. #1
    Registered User
    Join Date
    01-03-2014
    Location
    Jordan
    MS-Off Ver
    Excel 2010
    Posts
    5

    Variable Workbook name

    Hello Guys,
    I'm facing an issue and i will be grateful if you can give me a hand.

    I have an excel sheet that will be reading values from specific cells from other excel workbooks, the thing is that i need the file name (in the formula) to be variable, to make more sense please notice the below reference

    ='C:\Users\John\Desktop\Evaluation\Eval\[1876-192013.xlsx]Sheet1'!H37

    I need this part (1876-192013.xlsx) to be variable according to the values of cells in the same sheet (somethimg like C6&"-"&D9), so it will fetch the data from the corresponding excel files with the same title. How can i do this? preferably without VB.

    your help is highly appreciated,
    Thank you,

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Variable Workbook name

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Registered User
    Join Date
    01-03-2014
    Location
    Jordan
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Variable Workbook name

    Thank you verymuch for the response KOKOSEK,

    But something weird happened, it correctly referenced the values of the cells in this sheet, but it somehow did not fetch the the value that is in the H37 cell in the other sheet.
    it only results in the following
    'C:\Users\John\Desktop\Evaluation\Eval\[1876-192013.xlsx]Sheet1'!H37
    the cells i'm refrencing indeed have these values (1876 and 192013) but after this i need it to fetch the value in the H37 in the 1876-192013.xlsx file.

    Thank you again for your efforts,
    highly appreciated,

  4. #4
    Registered User
    Join Date
    01-03-2014
    Location
    Jordan
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Variable Workbook name

    Any help guys, Pretty Please

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Variable Workbook name

    This question was asked so many times in this forum.

    Making the cell value as reference then it requires Indirect() function.

    Without using Indirect() function we can't make the cell value as reference.

    But Indirect works with open workbook reference only. Indirect wont work with closed workbooks.

    So, if you want to reference it to the closed workbook then you can use Indirect.Ext of MoreFunc addin which will work with closed workbook too.

    Refer the below link to get Morefunc addin / usage.

    http://www.ashishmathur.com/?s=morefunc


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

+ 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. Replies: 3
    Last Post: 11-19-2014, 04:09 PM
  2. Replies: 4
    Last Post: 03-06-2014, 07:49 PM
  3. using a variable workbook's name to define another variable
    By lordterrin in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-30-2013, 05:57 PM
  4. [SOLVED] Assign entire row to variable, how do you paste variable values in a new workbook?
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2013, 08:01 PM
  5. Copy variable range from variable workbook to variable range on current workbook
    By Locster79 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-09-2013, 10:37 AM
  6. [SOLVED] TypeName limitation: How to distinguish Worksheet Variable from Workbook variable
    By bagullo in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-02-2013, 07:35 AM
  7. [SOLVED] Copy/paste data from one workbook to another but workbook name variable
    By Jiptastic in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-11-2013, 12:14 PM

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