Hello, quick praise and then my question.
Below is code I got help on that works great. It allowed me to change over
10,000 folder names from what they were to what they uniquely needed to be.
AlphaFrog helped me and I wanted to say thanks again.
Sub ChangeFolders()
Dim curfolder As String
Dim mypath As String
Dim dirLook As String
curfolder = "C:\Users\Joe\Desktop\Test\"
dirLook = Dir(curfolder, vbDirectory)
Do While dirLook <> vbNullString
mypath = dirLook
Call Rename_Folders
dirLook = Dir
Loop
End Sub
Sub Rename_Folders()
Dim cell As Range
For Each cell In Range("A1", Range("A" & Rows.Count).End(xlUp))
Name cell.Value As cell.Offset(, 1).Value
Next cell
End Sub
My next task is more complicated:
I have to search each folder and copy anywhere from zero (if the file is
not in that folder) to 10 or more unique files. The copied files need to be
put in a folder using mkdir that has the same name as the folder they where
found in.
My first step is to create a master directory for all the subfolders to be
placed in.
What I am wondering is: using the above code how do I change the
curfolder = "C:\Users\Joe\Desktop\Test\"
dirLook = Dir(curfolder, vbDirectory)
Do While dirLook <> vbNullString
to also loop thru the subfolders.
Any help would be great.
Thanks
Joe
Bookmarks