Opening file question

  • Thread starter Thread starter Les
  • Start date Start date
L

Les

Hi all,

Is it possible to open a file if you only know part of the file name ?

For example, using a wild card. file name is
"Regressliste UX_01.06.08 To 30.06.08.xls" - The dates can vary so i would
only like to use "Regressliste UX *.xls", is this possible ??

Any help would be greatly appreciated.
 
Les,

try this

Sub standard()
getbook = True
Do
If getbook = True Then
Filename = Dir("c:\Book*.xls")' Change to suit
getbook = False
Else
Filename = Dir()
End If

If Filename <> "" Then
Workbooks.Open Filename:=Filename
'Do something
End If
Loop While Filename <> ""
End Sub

Mike
 
Thanks Mike H
--
Les


Mike H said:
Les,

try this

Sub standard()
getbook = True
Do
If getbook = True Then
Filename = Dir("c:\Book*.xls")' Change to suit
getbook = False
Else
Filename = Dir()
End If

If Filename <> "" Then
Workbooks.Open Filename:=Filename
'Do something
End If
Loop While Filename <> ""
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top