View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
colofnature[_14_] colofnature[_14_] is offline
external usenet poster
 
Posts: 1
Default Opening file with date tags


Replace the line

Set wb = Workbooks.Open(sfilename)

with the following:

NewestFileName = sfilename
FileDate = FileDateTime(sfilename)
Do while sfilename < ""
sfilename = sPath & "\" & dir()
if FileDateTime(sfilename) FileDate then
NewestFileName = sfilename
FileDate = FileDateTime(sfilename)
end if
loop
Set wb = Workbooks.Open(NewestFileName)


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=544793