Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using this code:
Dim s1 As String, s2 As String, sName As String s1 = "C:\EPLC\Audits" s2 = "C:\EPLC\Audits\Completed\" sName = Format(Date, "ddmmyy") & " NW AB.xls" FileCopy s1 & sName, s2 & sName Workbooks.Open s1 & sName Kill s1 & sName but what i want to do is if the day is Monday i want to load an .xls file with filename : "date of the friday previous + NW AB.xls" so this week for instance. as today is Wednesday i want to load the .xls file with the filename : "30.07.2004 NW AB.xls" Can anyone please suggest the code to fulfill this need. Many thanks --- Message posted from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
DOH!
What am i on ?? I mean as today is Monday then i want to load last fridays fil -- Message posted from http://www.ExcelForum.com |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If not Monday, it loads the today date file?
Dim s1 As String, s2 As String, sName As String s1 = "C:\EPLC\Audits" s2 = "C:\EPLC\Audits\Completed\" If Weekday(Date) = 2 Then sName = Format(Date-3, "ddmmyy") & " NW AB.xls" Else sName = Format(Date, "ddmmyy") & " NW AB.xls" End If FileCopy s1 & sName, s2 & sName Workbooks.Open s1 & sName Kill s1 & sName -- HTH ------- Bob Phillips "Jako " wrote in message ... I am using this code: Dim s1 As String, s2 As String, sName As String s1 = "C:\EPLC\Audits" s2 = "C:\EPLC\Audits\Completed\" sName = Format(Date, "ddmmyy") & " NW AB.xls" FileCopy s1 & sName, s2 & sName Workbooks.Open s1 & sName Kill s1 & sName but what i want to do is if the day is Monday i want to load an .xls file with filename : "date of the friday previous + NW AB.xls" so this week for instance. as today is Wednesday i want to load the .xls file with the filename : "30.07.2004 NW AB.xls" Can anyone please suggest the code to fulfill this need. Many thanks --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to load .xla file automatically? | Excel Discussion (Misc queries) | |||
how do i down load excelspread sheet file | Setting up and Configuration of Excel | |||
File did not load completely | New Users to Excel | |||
File will not load | Excel Discussion (Misc queries) | |||
How to load a help file using VBA | Excel Programming |