Use wildcard features in VBA code (Macro) to locate file in Windows Explorer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deve8ore
    New Member
    • Apr 2008
    • 34

    #1

    Use wildcard features in VBA code (Macro) to locate file in Windows Explorer

    Hello,

    I have built a macro to automatically go to a specific directory and a specific folder, however the names of the files I need to automatically locate change names every month.

    I.e. - I hit the macro button and I'd like to automatically open a (pdf,xls,doc) file:

    "C:\Matt\Files\ Pricing\Reports \GrossMargin\9279RebateDetai l.xls"

    The only part of the file name that changes every month are the first four numbers before "RebateDeta il", and it's the only file with that name in the folder.

    Can anyone assist with the code needed to automatically open the "RebateDeta il" file, regardless of the preceeding four digits?

    Thank you!

    Matt
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by deve8ore
    Hello,

    I have built a macro to automatically go to a specific directory and a specific folder, however the names of the files I need to automatically locate change names every month.

    I.e. - I hit the macro button and I'd like to automatically open a (pdf,xls,doc) file:
    ...

    Thank you!

    Matt
    Greetings, deve8ore!

    Has to be annoying trying to figure this out. I will send over to the Access forum for a proper response. Sorry I am not too comfortable in Macros:-)

    See you soon!

    Dököll
    Last edited by Dököll; Apr 4 '08, 04:23 AM. Reason: text...

    Comment

    • deve8ore
      New Member
      • Apr 2008
      • 34

      #3
      Originally posted by Dököll
      Greetings, deve8ore!

      Has to be annoying trying to figure this out. I will send over to the Access forum for a proper response. Sorry I am not too comfortable in Macros:-)

      See you soon!

      Dököll
      --------------------------

      Thanks much, it is appreciated!

      Comment

      Working...