ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update filename (https://www.excelbanter.com/excel-programming/296468-update-filename.html)

odonnke

Update filename
 
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

--
Message posted from http://www.ExcelForum.com


Chip Pearson

Update filename
 
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



"odonnke " wrote in
message ...
I want be able to have the code update automatically. below is

the code
now, I need to manually update the filename every day as a new

one is
created everyday, how can I put in code that knows that

tomorrows file
will be AR042904.xls. I also need to look at the previous days

file
name too. Any ideas
Workbooks.Open Filename:="K:\Collections\Client

AR\AR042804.xls"


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 12:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com