Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Updating date

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Updating date

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

--
Regards,
Tom Ogilvy


"Richard Leclezio" wrote in message
...
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



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
automatically updating a date Pascale Excel Discussion (Misc queries) 1 September 16th 08 05:23 PM
Updating with current date Gloria Lewis Excel Discussion (Misc queries) 0 February 26th 08 08:55 PM
date updating Katie Excel Worksheet Functions 1 August 17th 07 11:48 PM
updating date! via135 Excel Worksheet Functions 3 February 23rd 06 05:31 PM
printing while updating date... soundgarden Excel Discussion (Misc queries) 1 November 1st 05 10:57 PM


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

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

About Us

"It's about Microsoft Excel"