Update filename

O

odonnke

I want be able to have the code update automatically. below is the cod
now, I need to manually update the filename every day as a new one i
created everyday, how can I put in code that knows that tomorrows fil
will be AR042904.xls. I also need to look at the previous days fil
name too. Any ideas
Workbooks.Open Filename:="K:\Collections\Client AR\AR042804.xls
 
C

Chip Pearson

Try something like

Dim FName As String
FName = "K:\Collections\Client AR\AR" & Format(Now+1, "mmddyy") &
".xls"
Workbooks.Open Filename:=FName

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top