+ Reply to Thread
Results 1 to 10 of 10

Help with Open File from Directory

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Help with Open File from Directory

    Dear Superusers,

    Could someone please tell me how I can add the 'select file from directory' for below mentioned code?

    Currently the code is picking all files that are in the folder location, however, I would like to select them.
    Tried couple of things but failed...

    Thanks for your help!



    Please Login or Register  to view this content.

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

    Re: Help with Open File from Directory

    Try this
    Please Login or Register  to view this content.
    Change it as per your requirement.
    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]

  3. #3
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Help with Open File from Directory

    Thanks Alrette for the Quick Reply - can you help me with adding a directory to this as well?

  4. #4
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Help with Open File from Directory

    Quote Originally Posted by MarianneBal View Post
    Thanks Alrette for the Quick Reply - can you help me with adding a directory to this as well?
    And I would need to select multiple files.

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

    Re: Help with Open File from Directory

    Use this line
    Please Login or Register  to view this content.
    (change it to your system path)

    before the code i gave you.

  6. #6
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Help with Open File from Directory

    Hello again,

    It's not working - I also need to select multiple files...

    Any suggestions?

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

    Re: Help with Open File from Directory

    What error are you getting? I tested it at my end and it works. When it prompts you to open the file, the folder you have selected will popup.

    To repeat for multiple files, do you want a popup asking "Do you want to open another file?" ?

  8. #8
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Help with Open File from Directory

    Hello Arlette,

    With the code I want to get a POP UP where I can selecte multiple files.

    From my selection I want the code to copy the first worksheet in the Active Workbook.
    (this part does actually work, but with my code mentioned above it picks automatically all files in the folder)

    For another sheet I have a code that allows me to select multiple files, but I'm somehow not able to 'merge' those 2 codes.

    The Code with the multiple file selection that works is:

    Please Login or Register  to view this content.

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

    Re: Help with Open File from Directory

    Do you mean select multiple files at one time itself, using the Ctrl key?

    Is there a specific reason why you want to personally (i mean physically) select the files instead of having the macro do it?

  10. #10
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Help with Open File from Directory

    I would rather have the possibility to select the files manually, as the files are in different folders every month and as I won't be the only user, I rather not want other users overwriting the code.

    Yes, Multiple files with Ctrl key.

    Furthermore, I was wondering if it would be possible to add the value of a Range to the name of the new Worksheets (that were copied to the active workbook)?

    Thanks so much for your help!
    Last edited by MarianneBal; 03-27-2012 at 10:28 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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