Hi,
I have a document saved with the name "Q114 XXXXXX".
I want to have a macro that replaces Q114 with Q214.
Is that easy to make?
Thanks!
Hi,
I have a document saved with the name "Q114 XXXXXX".
I want to have a macro that replaces Q114 with Q214.
Is that easy to make?
Thanks!
See my reply below...seems like my reply initially doubleposted
Last edited by vnzerem; 03-11-2014 at 12:19 PM.
Lets assume that you have the Old file name in Column A and the New name in Column B. Make sure you have the complete name of the file you want to rename and to what you want.
For example, I tried this on
Column A
C:\Users\Desktop\test.xlsm
Column B
C:\Users\Desktop\testrename.xlsm
Hence you can list all the files you want to change and the macro will loop and change everything.
The code below should rename the file to what you want.
Select Code copy to clipboard
Don’t forget to click the star if this helped you, and don’t forget to mark the thread as solvedPlease Login or Register to view this content.
Try this...
Please Login or Register to view this content.
@Xx7....I guess you are assuming that the "document" to be renamed is only an excel document by using ActiveWorkbook.Name. If you have .pdf and other extensions, it will have a limitation. That is why I prefer to loop through the documents
Hello,
Thank you for the replies,
The names of the documents differ, but they all have Q114 in them. I guess Xx7's sollution is the best?
Xx7 - the formula didn't work.
The files are still named Q114
Xx7 method will change only one file name (excel file). But if you have multiple names and multiple documents (.doc, .pdf etc) you can list them as I specified in Column A and B, and loop through the documents.
Don’t forget to click the star if this helped you, and don’t forget to mark the thread as solved
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks