Updating date

  • Thread starter Thread starter Richard Leclezio
  • Start date Start date
R

Richard Leclezio

I am showing you a cross section of some code :

Sub Download_Nostros()
Sheets("Data").Select
ActiveSheet.Unprotect
Range("All_NOSTRO").Select
Selection.ClearContents
Workbooks.Open FileName:= _
"\\my_documents\downloads\P51GRPR-SEP15.xls"
Range("A1:K500").Select
Selection.Copy

How do I automatically update or change "P51GRPR-
SEP15.xls" to the next working day. Any help would be
greatly appreciated.

Richard
 
Dim nDay as Long, sStr as String, fName as String
sStr = "\\my_documents\downloads\P51GRPR"
nday = Choose(weekday(Date),1,1,1,1,1,3,2)
fname = sSTr & ucase(format(date+nday,"MMMDD")) & ".xls"

Workbooks.Open Filename:=fname
 
Back
Top