Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is it possible to load an .xls file

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Is it possible to load an .xls file

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Is it possible to load an .xls file

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to load .xla file automatically? Eric Excel Discussion (Misc queries) 1 November 17th 08 01:04 PM
how do i down load excelspread sheet file abdee Setting up and Configuration of Excel 1 May 18th 05 10:39 PM
File did not load completely Jackie Lamorie New Users to Excel 1 April 16th 05 12:29 PM
File will not load Jack Sheet Excel Discussion (Misc queries) 3 December 4th 04 01:41 PM
How to load a help file using VBA Ian[_9_] Excel Programming 2 January 30th 04 02:19 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"