+ Reply to Thread
Results 1 to 6 of 6

Rename multiple files in folder

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    Eden Prairie, MN
    MS-Off Ver
    Excel 2010
    Posts
    39

    Exclamation Rename multiple files in folder

    Hi All -

    I'm looking for some assistance in creating a macro which will rename files in specified folder.


    FolderPath = "L:\Cognos Report Output\Change Control Reports"
    Filenames contain _2A at the beginning and in the middle of the file name which I would like removed. (_2AAvg Cap Cost_2AQTR - Budget.xlsx)

    Thanks in advance to anyone who can help.

  2. #2
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Rename multiple files in folder

    Give this a try

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    Eden Prairie, MN
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Rename multiple files in folder

    Hi Mike

    Oddly enough I've tried something similar to your code but in both your code and my code I get the same error

    Run-time error '58':

    File already exists

    Please Login or Register  to view this content.

    Any ideas?

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Rename multiple files in folder

    So say you have a file named _2AAvg Cap Cost_2AQTR - Budget.xlsx and you want to rename it Avg Cap CostQTR - Budget. If your getting that error its because there is a file in that folder already named Avg Cap CostQTR - Budget.

  5. #5
    Registered User
    Join Date
    12-21-2012
    Location
    Eden Prairie, MN
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Rename multiple files in folder

    Wow... I'm losing it!!

    I looked for the file over and over prior to creating this thread and couldn't for the life of me find it. Looked again and it's staring me right in the face.

    Thank you Mike

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Rename multiple files in folder

    MissaLissa,

    Sometimes its like that...

    Glad you got it straight.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1