+ Reply to Thread
Results 1 to 2 of 2

VBA to open multiple files with different, unknown file names

  1. #1
    Registered User
    Join Date
    02-28-2014
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    1

    VBA to open multiple files with different, unknown file names

    Hello-
    I'm trying to build a macro to open multiple files at one time that will always be saved in a consistent drive. The problem is that sometimes there will only be one file for a month (ie only at month-end) and other times, there may also be additional files for different dates throughout the month. I wont know ahead of time how many files there will be, but they will always be saved in the same file name type that is "FILE DESCRIPTION MM-DD-YYYY". How can I build a loop that looks for a file on each possible day but doesn't error out if the file doesn't exist? Thanks!

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA to open multiple files with different, unknown file names

    Quote Originally Posted by jreed52 View Post
    Hello-
    I'm trying to build a macro to open multiple files at one time that will always be saved in a consistent drive. The problem is that sometimes there will only be one file for a month (ie only at month-end) and other times, there may also be additional files for different dates throughout the month. I wont know ahead of time how many files there will be, but they will always be saved in the same file name type that is "FILE DESCRIPTION MM-DD-YYYY". How can I build a loop that looks for a file on each possible day but doesn't error out if the file doesn't exist? Thanks!
    Will there be files form other months in the same folder?
    If yes, do you want to include or exclude those files?
    If exclude, what month do you want?

    This example will open all FILE DESCRIPTION files (regardless of date) in a folder.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 02-28-2014 at 12:11 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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. [SOLVED] Create multiple files with file names the same as cell value
    By Ocean Zhang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-05-2013, 10:35 AM
  2. [SOLVED] Macro to open multiple files with changing names
    By KeithMale in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-27-2013, 07:28 PM
  3. Consolidate Data from Multiple Files (Different File Names) into a Master File
    By dspraveen_23 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-08-2012, 12:59 PM
  4. Unknown files Names
    By bazzah in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-12-2007, 07:59 AM
  5. [SOLVED] Excel 2003 - When I open files, why are some file names blue?
    By Formula One in forum Excel General
    Replies: 2
    Last Post: 08-17-2006, 01:00 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