+ Reply to Thread
Results 1 to 6 of 6

Import values from other files in folder

  1. #1
    Registered User
    Join Date
    06-18-2013
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    15

    Import values from other files in folder

    Hello - Thanks for taking the time to read this thread.

    I need a macro that imports the value from a specific cell from all the spreadsheets in the same folder as the workbook running the code.

    This is my "failed" attemp. It works on my pc but doesn't work on other people's pc (they have older versions of excel). So I guess there must be a much better way to do this

    Please Login or Register  to view this content.
    What I lack the skills to do
    I would really like a code that could import the value from cell: Worksheets("Efficiency").[I4], from any spreadsheet in the same folder as thisworkbook no matter what fileextension it has if the spreadsheet has a value in that cell (should of course skip looking in the spreadsheet running the code, which will be in the same folder as the different status reports).
    It would be great if the code could detect the users application.screenupdating status and set it to their prior setting after the code (no clue if this is possible).

  2. #2
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Import values from other files in folder

    Hi
    In your code trying change "xlsx" to "xl*". This should fix your issue.
    Tony

  3. #3
    Registered User
    Join Date
    06-18-2013
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Import values from other files in folder

    Hi Tony

    Just tried change "xlsx" to "xl*" but it cycles through the spreadsheets without opening them, doesn't seem that the wildcard works AND this would also try to open the excel file running the code, which is in the same folder - and that would stop the code from running

  4. #4
    Registered User
    Join Date
    06-18-2013
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Import values from other files in folder

    After some trial and error I ended up with this code that works

    Please Login or Register  to view this content.
    Still have some small things on my to do list but I'm pretty satisfied so far

  5. #5
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Import values from other files in folder

    Hi
    Thanks for the feedback. Pleased you managed to resolve your issue.
    Tony

  6. #6
    Registered User
    Join Date
    06-18-2013
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Import values from other files in folder

    The final code looks like this if anyone else is facing the same issues

    Please Login or Register  to view this content.

+ 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: 2
    Last Post: 03-23-2013, 04:17 AM
  2. Noob 4 Help - Macro to LIST ALL FILES IN FOLDER and then IMPORT ALL LISTED FILES
    By StlSmiln in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-25-2012, 04:02 AM
  3. Replies: 1
    Last Post: 01-24-2006, 11:35 AM
  4. Replies: 1
    Last Post: 01-24-2006, 11:00 AM
  5. Replies: 1
    Last Post: 01-24-2006, 12:25 AM

Tags for this Thread

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