LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Change file names in a folder

Hi to all
I am trying to change the names of all the files in a folder by putting a
new month and year at the end of each file name using the following code:
Dim f as String, s as String
Const Dest = "C:\Mis documentos\12 December 2005\"
f = dir(Dest & "*.*")
do while f < ""
s = Mid(f, 1, (Len(f) - 9)) & _
Format(DateSerial(Year(Date), Month(Date) - 1, 1), "yyyy-mm")
Name Dest & f As Dest & s
f = dir()
Loop

It gets stuck in the following code:
Name Dest & f As Dest & s
Then I tried:
Name f As s
It Didn´t work. then I tried:
Name f As Dir(Dest & s)
It didn´t work
The message keeps on saying that it cannot find the root directory access.
Any solutions or ideas? It would be appreciated.
Regards
TISR

 
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 create a list of file names within a folder in Microsoft Ex Seablue Excel Discussion (Misc queries) 2 April 9th 07 08:44 PM
Change names of Files in a folder TISR Excel Programming 1 April 1st 06 10:40 AM
Compare file names to folder contents marlea[_14_] Excel Programming 3 March 16th 06 03:59 PM
Change names of files in a folder to match names in Excel Column saybut Excel Programming 4 February 9th 04 06:26 PM
Extract file names last save info from a Folder Harapa Excel Programming 0 November 16th 03 04:33 PM


All times are GMT +1. The time now is 09:50 PM.

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"