+ Reply to Thread
Results 1 to 4 of 4

Help referencing a file

  1. #1
    Registered User
    Join Date
    09-02-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    16

    Help referencing a file

    Hello would anyone mind giving me a hand with the indirect function but let me start with what I am trying to achieve basically I will have a list of excel documents which are all invoices containing a cell with cash values and they will all be named the same except the digit at the end is incremented by 1 so what I want is a excel document that can pull the cash value from each invoice but I want it to pull the name of the file from a cell which I will input the name of the invoice. So far I have two test documents and in the first I have A1 as the excel document name B1 as the sheet name and C1 as the cell I want to the pull the info from and I have created a seperate spreadsheet with the same name as in A1 and the same sheet names as in B1 and placed random data in C1 and used this code to pull from it =INDIRECT("'["&A1&".xlsx]"&B1&"'!"&C1). This works however I want to make it so rather then using the values of B1 and C1 I can just type in a sheet name and cell name as this will remain a constant but any way I try and enter it, it will not accept it. Any help would be great and thank you in advance.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Help referencing a file

    =INDIRECT("'["&A1&".xlsx]Sheetname'!A1").

  3. #3
    Registered User
    Join Date
    09-02-2013
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Help referencing a file

    You sir are a legend. Thank you very much

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Help referencing a file

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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: 5
    Last Post: 03-21-2013, 07:34 AM
  2. File Referencing
    By bb5931 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-18-2013, 02:35 PM
  3. Excel file referencing a large central macro file?
    By alanzero in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-25-2011, 08:29 PM
  4. Referencing a file name
    By Neil07979 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-18-2007, 09:14 AM
  5. Referencing a 2nd file
    By goldcomac@mac.com in forum Excel General
    Replies: 1
    Last Post: 05-28-2006, 02:30 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