+ Reply to Thread
Results 1 to 3 of 3

Open files that have a variable date format in the name

  1. #1
    Registered User
    Join Date
    06-05-2010
    Location
    Belgrade
    MS-Off Ver
    Excel 2007
    Posts
    2

    Open files that have a variable date format in the name

    Macros (attached) task is to open today's file from a folder, copy its contents in Excel sheet and close it.
    The files are saved by the application with a strange criteria. Random saves files in formats "d.m.yyyy" or "d.mm.yyyy" or "dd.m.yyyy" or "dd.mm.yyyy" (like "7.5.2016-K.xml" or "7.05.2016-K.xml" or "07.5.2016-K.xml" or "07.05.2016-K.xml"), and I can not affect it.
    The macro works perfectly until a date is in ONE of the format above.
    Is there a possibility to declare "myToday = Format(Date, "dd.m.yyyy")" with multiple criteria which will include all date formats above, so the macro identifies the file regardless of the date format.

    Thanks

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 06-12-2016 at 08:46 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Open files that have a variable date format in the name

    Something like this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-05-2010
    Location
    Belgrade
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Open files that have a variable date format in the name

    You are wrong, not "Something like this", just this.

    Thanks so much

+ 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. Open files within date range
    By originalJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2016, 12:37 PM
  2. macro to open files and copy specific sheet into new workbook (have open files part)
    By dangerdavedsp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 02:23 PM
  3. Replies: 4
    Last Post: 09-01-2014, 07:57 PM
  4. Macro to open multiple files, remove header and save multiple files in a new format
    By twocircles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2014, 05:24 PM
  5. [SOLVED] Macro to open files with diffrent date format
    By suyogpatil in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-28-2013, 07:10 AM
  6. Macro to open files based on string variable
    By Coeus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2013, 06:47 PM
  7. Macro to open, copy/paste, and close files with variable name
    By mjr33 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2011, 10:20 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