+ Reply to Thread
Results 1 to 2 of 2

Macro to rename photos in a main folder's subfolders to subfolder names

  1. #1
    Registered User
    Join Date
    02-22-2014
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    1

    Macro to rename photos in a main folder's subfolders to subfolder names

    Hi, there.

    I am looking for some assistance on a macro I'm creating. The goal is to have a cell where a filepath can be typed in for a certain target folder (I may try to update later to where you can browse to the target folder). This target folder has many subfolders, each of which can have varying numbers of photos. The macro needs to go to go through each subfolder with the main target folder and rename all photos within that subfolder to the subfolder name. For example, the subfolders have generic names like "A", "B", "C", etc. The photos in subfolder "A" need to be named "A (1)", "A (2)", "A (3)", and so on for all the photos within that subfolder. Then the macro does this for every subfolder in the target folder's directory.

    I currently have the attached file with the macro working that uses FileSystemObject. I'm pretty happy with it so far, but the issue is that in order to get FSO recognized, I had to select the "Microsoft Scripting Runtime" reference within VBA. So if I try to let someone else use it, I will have to go through that process with each person, correct?

    So my question is how to make this work without using FileSystemObject. And also wanted to share it somewhere since I could not find a macro online that specifically did this.

    Thanks

    Edit: Forgot to attach an example of folder with subfolders and photos
    Attached Files Attached Files
    Last edited by Spardante; 02-22-2014 at 04:36 PM.

  2. #2
    Forum Contributor
    Join Date
    04-03-2012
    Location
    Washington State
    MS-Off Ver
    Excel 365
    Posts
    340

    Re: Macro to rename photos in a main folder's subfolders to subfolder names

    Hi... Are you just doing this in Excel to rename all picture files in a folder? Or is there another reason for using Excel?

+ 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. Macro that searches in folder and subfolder - please help
    By anaconte1010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2013, 10:11 AM
  2. [SOLVED] Loop through all sub-folders of a main folder and rename sheet same as workbook name
    By sans in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 12-11-2012, 02:01 PM
  3. Macro to Create Folder\Sub Folder\SubFolder\
    By coolhit in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-30-2012, 12:43 PM
  4. Macro to export folder and subfolder names in Excel?
    By Mustang in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-02-2010, 09:13 PM
  5. Dir folder and subfolder macro wont dir as aspected
    By Pero in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2009, 03:22 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