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: 2
Default rename all files in a folder

This routine renames the file "old.jpg" with a new 8 digit name consisting
of today's day, hour, minute and second.





How can I modify this so it loops through all of the files in that directory
and renames them?



Sub RenamePIX()

Dim x As String, y, z, OldName, NewName

x = "C:\Documents and settings\user\my documents\PIX\"

y = Format(Date, "dd")

z = Format(Time, "hhmmss")

OldName = x & "OLD.jpg": NewName = x & y & z & ".jpg"

Name OldName As NewName

End Sub




 
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
Pulling pdf files from general folder to specific folder [email protected] Excel Discussion (Misc queries) 2 September 8th 09 09:41 PM
How to create a copy of a folder having five files in it, & rename Matthews Excel Worksheet Functions 1 November 7th 06 03:42 PM
how can I specific a folder with wildcard criteria and excel will import all the correct files in that folder? Raven Excel Discussion (Misc queries) 1 January 24th 06 03:28 PM
How to copy 30 csv files from a folder to another folder ddiicc Excel Programming 1 July 17th 05 09:42 AM
rename folder o files with value from inside each wbk Max Bialystock Excel Programming 2 January 2nd 04 09:24 AM


All times are GMT +1. The time now is 05:44 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"