+ Reply to Thread
Results 1 to 4 of 4

Macro to get value from a file

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2003
    Posts
    12

    Macro to get value from a file

    Hey guys,
    If for example in cell A1 I have a link hard-coded in,
    C:\sales\2011 Budget\January.xls
    In Cell B1 i need the value of a certain cell in that file

    Is there a macro that would go find that file and look for a specified worsheet and give me the value in a specified cell ?

    Thanks
    Last edited by JoeNK; 10-12-2012 at 04:06 PM.

  2. #2
    Registered User
    Join Date
    08-15-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Macro to get value from a file

    Quick and dirty but something like this should work:

    Please Login or Register  to view this content.
    You can modify the references to the sheets and cells to return the value from the correct cell in wb2 to whatever cell you want in wb1.

    Also keep in mind that the reference to the other file is exact. For example I was initally having a problem with this code because my workbook was January.xlsx and not January.xls. Be mindful of the file name extension based on what version of Excel you are using.
    Last edited by g8r777; 10-12-2012 at 12:46 PM.

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Denver, Colorado
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro to get value from a file

    Sweet, it worked
    Thanks for the quick reply

  4. #4
    Registered User
    Join Date
    08-15-2012
    Location
    Las Vegas
    MS-Off Ver
    Excel 2010
    Posts
    87

    Re: Macro to get value from a file

    Glad to help.

    Please mark this thread as SOLVED by going to Thread Tools -> Mark this thread as solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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