numms Posted September 26, 2008 Posted September 26, 2008 I'm sorry for asking what I'm sure is a very basic question...Here's the situation: We have an excel file that's exported monthly and saved in a directory \\reporting\ScoreCard\Scorecards-2008-09-Sep-Fiscal.xlsI need to copy and rename it to \\reporting\Prepfiles\Scorecards.xlsThe problem I'm having is in writing a script to copy this from one directory to another with the name changing. I can handle this copy in either DOS through a command batch, or in VBA in the background of an Access project that has a table linked to the \\reporting\Prepfiles\Scorecards.xls file. I've run across several examples where the files are simply named 200809, but how can I translate that into the three character month name?Any help on this would be greatly appreciated, and again, I'm sorry for what should be a simple answer.
jaclaz Posted September 27, 2008 Posted September 27, 2008 If I get right your question, you can start from some of the ideas posted here:http://www.msfn.org/board/Rename-File-With...-Fi-t47812.htmlThan, once you have a variable %month% defined as 01, 02, 03, etc., you have to replace 01 with JAN, 02 with FEB, etc.Since I donìt think you need to take into account the efficiency of the code, a serie of:IF %month%.==01. SET month=JANIF %month%.==02. SET month=FEBIF %month%.==03. SET month=MARshould do.jaclaz
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now