View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike Fogleman Mike Fogleman is offline
external usenet poster
 
Posts: 1,092
Default open a file in VB that the date changes every day.

Which is it?
What if the file name is always preceeded by the date.

DateFilename
but has the date at the end always change?

FilenameDate

Either way the filename would be like this for today's date:

Sub test()
Dim MyDate As String
Dim MyFile As String

MyDate = Format(Date, "mm_dd_yy")
MyFile = "SomeFile " & MyDate & ".xls" '= "SomeFile 10_05_05.xls"
'or
MyFile = MyDate & " SomeFile.xls" '= "10_05_05 SomeFile.xls"
End Sub

Mike F

"Michael from Austin" wrote in
message ...
What if the file name is always preceeded by the date. How did I get a
macro
to open up a file that is named the same all the time, but has the date at
the end always change?

--
Regards,
Michael