Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Suppose i have a Folder August 07 Inside there are 50 folders of Different Employees Under Each folder i have one Excel File with the name of "Format for the 1st Aug to 10 Aug" Now what i want is to change the name of the File from "Format for the 1st Aug to 10 Aug" to "Current Time Sheet For 1st Aug to 10th Aug" How can i do that.... Thanks Regards Akash |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is the code. Change MyPath to match your filesystem
Sub renamefile() Dim fs, f, f1, fc, s Const MyPath = "c:\temp\August 07" Const OldfileName = "Format for the 1st Aug to 10 Aug" Const NewfileName = "Current Time Sheet For 1st Aug to 10th Aug" Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.GetFolder(MyPath) Set employees = f.SubFolders For Each employee In employees Set f1 = fs. _ getfile(employee & "\" & OldfileName) f1.Name = NewfileName Next MsgBox s End Sub "Akash" wrote: Hi, Suppose i have a Folder August 07 Inside there are 50 folders of Different Employees Under Each folder i have one Excel File with the name of "Format for the 1st Aug to 10 Aug" Now what i want is to change the name of the File from "Format for the 1st Aug to 10 Aug" to "Current Time Sheet For 1st Aug to 10th Aug" How can i do that.... Thanks Regards Akash |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
update the hyperlink in file after changing the file name | Excel Worksheet Functions | |||
delete info from source file w/out changing the destination file | New Users to Excel | |||
Save as new file without changing existing file | Excel Programming | |||
Open Test file with VBA with a changing file number | Excel Programming | |||
Open delimited text file to excel without changing data in that file | Excel Programming |