Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to create a list of file names within a folder in Microsoft Ex | Excel Discussion (Misc queries) | |||
Change names of Files in a folder | Excel Programming | |||
Compare file names to folder contents | Excel Programming | |||
Change names of files in a folder to match names in Excel Column | Excel Programming | |||
Extract file names last save info from a Folder | Excel Programming |