+ Reply to Thread
Results 1 to 2 of 2

Automatically opening files from the filenames

  1. #1
    Registered User
    Join Date
    05-31-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    2

    Automatically opening files from the filenames

    Hi,

    Im new to VBA. Does anyone of you have idea how to automatically open several files one by one from the filenames given? (in VBA). The logic is that there must be some looping here.

    Thanks a bunch!

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Automatically opening files from the filenames

    Hi Febbry,

    To open a workbook in VBA you can use something like:
    Please Login or Register  to view this content.
    If you have a list of files somewhere - on a worksheet, in an array, etc. - you can loop through them quite easily. For example, if you have three workbooks listed in A1:A3
    Please Login or Register  to view this content.
    By default it will assume the file names are in the same folder as the workbook calling it, so if that's not the case you either have to put the full path into the cells, or add the path to the code (if it's the same for every file).
    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)

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