Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2008

    Unanswered: Variable File Selection?

    Hi Folks,
    I wrote the following macro the old-fashioned way (I recorded it!). It looks up and opens a file in another directory.
    but here's the thing: the file name will change! Is there a way I can modify the code to just get the MOST RECENT wk3 file? or ignore parts of the file name?

    Optimally, it would ignore the "391640" part, maybe just look for something with today's date?

    Appreciate any input!!!

    Sub Macro2()
    ' Macro2 Macro
    ' Macro recorded 6/4/2008 by L
    Workbooks.Open Filename:= _

    blah blah blah
    blah blah blah

    End Sub

  2. #2
    Join Date
    May 2008
    Raleigh, NC

    Using code you could look into your directory for a file with a particular name or filter. Then set a variable with that name and use the macro to call code that opens the file with that variable name.

    Hope this helps.
    --If its free, take it for what its worth!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts