+ Reply to Thread
Results 1 to 7 of 7

Open multiple files from a folder based on cell information?

  1. #1
    Registered User
    Join Date
    09-24-2007
    Posts
    7

    Open multiple files from a folder based on cell information?

    Hi,

    I would like to know how to open multiple excel files from a folder based on the information based in cells down a certain column until the last cell.

    I thought it might be something like this but it isn't:

    Please Login or Register  to view this content.
    I'm still a noob as it shows so any help would be good.

    Thanks
    Last edited by VBA Noob; 10-03-2008 at 08:37 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello bshape1,

    Provided your cells contain the full directory path and file name, this macro should work. One problem I see is with using UsedRange to find the last cell. This could cause your range to include lots of empty cells which will produce an error. You also declared totalrows as a String. You need a number for the loop to work. Also, you shouldn't define variables with names that are defined in VBA, like row in your code.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    09-24-2007
    Posts
    7

    Thumbs up I can't seem to get it to open the other files in the column is it possible?

    Thanks for the reply.

    I have used the above macro and it open the first one up. But I can't get it to open the others in the column.

    I'm using a spreadsheet with the names of some files downloaded from a website. Then I'm using a formula ="S:\iMacros Program\iMacros\Downloads\Markback_"&A2&".xls" to get the path.

    Name: Path:
    Jim S:\iMacros Program\iMacros\Downloads\Jim.xls
    James S:\iMacros Program\iMacros\Downloads\James.xls
    John S:\iMacros Program\iMacros\Downloads\John.xls

    I want the macro to open up all the spread sheets in the column from Jim to John. I can't use open whole folder because the names change each day and the files don't get deleted.

    Again thanks for any help you can give.

  4. #4
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    macro

    Hi
    you can try these codes if col A has the filepath with filename
    Please Login or Register  to view this content.
    Ravi

  5. #5
    Registered User
    Join Date
    09-24-2007
    Posts
    7

    Solved!

    Hi,

    Thanks for all your help. Had to make one adjustment to the above code for it to work. Here is the finished code:

    Please Login or Register  to view this content.
    Thanks

    B

  6. #6
    Registered User
    Join Date
    09-24-2007
    Posts
    7

    Can't mark solved

    Can a moderater to mark this solved?

  7. #7
    Forum Contributor
    Join Date
    02-27-2008
    Posts
    764

    modified code

    Hi
    Instead of activating the sheet, you can modify the code as follows
    Please Login or Register  to view this content.
    Ravi

+ 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. Import Specific line from multiple text files
    By Vlad999 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-14-2008, 06:50 PM
  2. Replies: 10
    Last Post: 04-05-2007, 12:54 AM
  3. Replies: 2
    Last Post: 11-23-2006, 09:54 AM
  4. Splitting one cell information into multiple
    By Dhruva101 in forum Excel General
    Replies: 9
    Last Post: 10-15-2006, 09:53 PM
  5. Open "ANY" excel files in a particular folder
    By Ayansane in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-26-2006, 12:47 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