I know using wildcards is risky, but I'm certain I can identify a unique file. If you know of a way to rename the file, old or current name with wildcards, to new name known in its entirety, it would really speed things up. Fortunately the first line of code, fn, identifies the precise file that needs deleting. At this point it's the best thing I have going. I then go back into the old folder and delete the old file. However, the need for wildcards over rides the time requirement.įn = Dir(myDir & Movie_Actor_Name1 & "*") ' Movie_Actor_Name1 & "*") is old name with wildcardįileCopy myDir & fn, newFolder & Replace(fn, Left(fn, InStr(fn, ".") - 1), Movie_Actor _ Name2) ' Movie_Actor_Name2 is the new, correct name or I should say had 3 problems, 1) I need to use wildcards, 2) some files (more then half) need to be renamed and 3) I would prefer to just move, not copy, because some of these fi les are movies and are large (> 1GB) to copy takes too long. I don't really need to copy a file, just move it, and in certain cases rename it. Your code needs to be highlighted! I have been searching for this for days now. I realize the post is over 3 years old but I see you’re still active. Re: File copying & renaming using VBA & WildCards
0 Comments
Leave a Reply. |