+ Reply to Thread
Results 1 to 1 of 1

Getting VBA to choosing which text file to import

  1. #1
    Registered User
    Join Date

    Getting VBA to choose which text file to import

    I've got a spreadsheet that several users have different copies of and they use it to export their results to text files periodically. The files is saved as their name and then the date of saving in format ddmmyy. ie 'john 190105' , or 'peter 180105' (uk date format). I then have another sheet that imports these files to be able to examine all the data together. Currently I have it so that you specify the date you want the files from, and the names of the users, so by specifying john and james, and 190105, it would bring in 'john 190105' and 'james 190105'.

    However, users will be saving as text files irregularly and on different dates, so I need VBA to import the most recent file. so if there was nothing saved for 190105 it would look for 180105 etc. How do I get VBA to do this? I'm aware that if I changed my date format to yymmdd they would then be ascending order, so I could get it to look for the max date, but how do I get it to examine the available files at all? This is outside the scope of the macro recorder!

    (the only other method I can think of is to have a central spreadsheet that records the date each user saves his files, so on importing it could look in here and itenfiy the most recent save and look for a file with this date; but its not very robust, as the file could get moved or deleted.)

    Last edited by G_Force; 01-19-2005 at 11:51 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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


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