+ Reply to Thread
Results 1 to 3 of 3

Renaming files in infinite number of sub folders

  1. #1
    Registered User
    Join Date
    02-20-2014
    Location
    Hobart, Tasmania AU
    MS-Off Ver
    Excel 2007
    Posts
    2

    Renaming files in infinite number of sub folders

    Firstly, I am very new to VBA and have been self teaching myself for the past couple of weeks so forgive me if I'm not using the right terminology or if I don't make sense (and any hints on cleaning up my code are always appreciated ).

    I have written a procedure that renames excel files within a folder based on certain words being in the title. It works for the files in the first lot of subfolders but I am trying to work out how to get it to rename all files in all subfolders regardless of the level.

    I've seen similar things done using recursive subs but I have been trying to convert some of the sample codes I've found online to fit my situation and am not having much luck.

    I'm hoping someone can tell me how to manipulate my code into something like a recursive procedure or anything else that will do what I want.

    Here is my code.

    Please Login or Register  to view this content.
    Thanks in advance

  2. #2
    Registered User
    Join Date
    10-11-2011
    Location
    FB Republic
    MS-Off Ver
    2016
    Posts
    36

    Re: Renaming files in infinite number of sub folders

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    02-20-2014
    Location
    Hobart, Tasmania AU
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Renaming files in infinite number of sub folders

    Thank you very much for your response mancubus. One comment line in your code made me realise I had no reference to Microsoft Scripting Runtime. Once I added this in I managed to get one of my previous attempts working. Here is the code I ended up using for anyone interested:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 09-12-2013, 09:23 PM
  2. Recursively Count Files in Folders and Sub-Folders
    By cdeshaz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2013, 01:15 PM
  3. Create folders and move and copy files into that folders
    By vijaybharthi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-31-2010, 04:01 AM
  4. Renaming files from a number string inside the file.
    By Gordon in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-24-2006, 01:10 PM
  5. Renaming folders and changing links accordingly
    By fullers in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2006, 08:00 AM

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