Here's how I would do that:
![]()
Option Explicit Sub RenameFiles() Dim fName Dim fPath: fPath = "C:\Documents and Settings\Desktop\pictures\" fName = Dir(fPath & "???-???-???-???-???-???-???.jpg") Do While Len(fName) > 0 Name fPath & fName As _ fPath & Application.WorksheetFunction.Substitute(fName, "-", " ", 4) fName = Dir Loop End Sub
Bookmarks