Good Morning - I have been looking for snippets but this doesn't look as easy as I thought it should be! (VBA never is, isn't it!?!)
We are moving our archive to Teams and our company name is really long so the length of the path becomes too long and we won't be able to open a lot of files. Also, there's portion we don't need so my project is two steps.
Delete all folders and content with a specific path name
I need to loop through folders by year, through all subfolders and find the ones with a specific name (and it will always be the same name) and delete these folders with the contents.
Change File Names
The company policy has been to write the file names with " - " and you won't believe it, they write veritable novels here as file names. So I want to go through all file names and replace this with an underscore for starters.
If that is not enough to bring us across the line, I might to find specific files and adjust the file names. I have a macro that can pull all the file names and put them into a spreadsheet so I can count the lengths and assign a new name. That portion should be manageable so I will actually have a spreadsheet with name OLD in one column and name NEW in another.
If anybody has code that does one or the other, I would be really grateful. If I can't find code, I think I can get around the first by simply search for the folder name and delete them manually. Still a lot of work but not totally impossible like the second task!
Thank you!
Christine
Auckland, NZ
We are moving our archive to Teams and our company name is really long so the length of the path becomes too long and we won't be able to open a lot of files. Also, there's portion we don't need so my project is two steps.
Delete all folders and content with a specific path name
I need to loop through folders by year, through all subfolders and find the ones with a specific name (and it will always be the same name) and delete these folders with the contents.
Change File Names
The company policy has been to write the file names with " - " and you won't believe it, they write veritable novels here as file names. So I want to go through all file names and replace this with an underscore for starters.
If that is not enough to bring us across the line, I might to find specific files and adjust the file names. I have a macro that can pull all the file names and put them into a spreadsheet so I can count the lengths and assign a new name. That portion should be manageable so I will actually have a spreadsheet with name OLD in one column and name NEW in another.
If anybody has code that does one or the other, I would be really grateful. If I can't find code, I think I can get around the first by simply search for the folder name and delete them manually. Still a lot of work but not totally impossible like the second task!
Thank you!
Christine
Auckland, NZ