+ Reply to Thread
Results 1 to 4 of 4

Open Two Files With Different Dates in Start

  1. #1
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Arrow Open Two Files With Different Dates in Start

    Hello
    I want to open two files in vba with the same data but with different file name e.g below. Main Problem is that on daily basis files dates changes.
    File1: 20210311 File
    File2: 20210312 File

    20210311 File contains last day data and 20210312 File contain Today data.

    I want to open the 1st Today file and then the last day file and extract new records from the Today file.

    After that, I want to use Today's file for further work. change in the filename on daily basis it is hard to fix the name in the code

    I do not want to rename files
    DO not want to pick the file because I am using files again and again.

    Cross Forum Post Link

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

    Re: Open Two Files With Different Dates in Start

    On the other site, put a link to this post so they know its cross-posted as well.

    This will open a file with today's date 20210312.xlsx
    Please Login or Register  to view this content.
    Yesterday's date 20210311.xlsx
    Please Login or Register  to view this content.
    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.

  3. #3
    Forum Contributor
    Join Date
    05-26-2016
    Location
    India
    MS-Off Ver
    Microsoft 2021
    Posts
    324

    Re: Open Two Files With Different Dates in Start

    Thanks AlphaFrog,
    Shared code is not working Moreover "File" is the fixed suffix after the date
    What if Today is 20210312 and Last day file is 20210310 then as per code -1 will be failed.

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

    Re: Open Two Files With Different Dates in Start

    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)

Similar Threads

  1. [SOLVED] VBA Open Files Inverts Dates
    By tigerdel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-28-2020, 10:55 AM
  2. Excel does not open all files in the Start folder
    By katto01 in forum Excel General
    Replies: 1
    Last Post: 02-12-2019, 03:40 PM
  3. 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
  4. Replies: 9
    Last Post: 03-05-2012, 08:17 AM
  5. Replies: 5
    Last Post: 06-30-2011, 03:26 PM
  6. How to set GetOpenfile dialog start path to current open files path.
    By Michael Wise in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-03-2010, 02:24 PM
  7. Replies: 1
    Last Post: 12-21-2005, 06:10 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