Consulting

Results 1 to 4 of 4

Thread: VBA code to rename folders

  1. #1
    VBAX Newbie
    Joined
    Dec 2016
    Posts
    2
    Location

    VBA code to rename folders

    Hello,

    What I want to do is list down all the folder and sub folder names in 1st column of excel, then rename it with names present in the second column of the excel sheet.

    Any help would be appreciated.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,900
    Location
    Welcome to the forum!

    Please post example values in A2 and B2.

    Would B2's path already exist?

  3. #3
    VBAX Newbie
    Joined
    Dec 2016
    Posts
    2
    Location
    Thanks kenneth !

    Example: A2 has folder name "Behavioural_Models"
    B2 has folder name "Models"

    so replacing A2 by B2.

    Also could you help if I have to rename folder inside a folder?

    Thanks.

  4. #4
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,900
    Location
    I feared as much. That is not explicit enough. I need the drive and path before those "folder" names. It is like saying, meet me at 1313 Mockingbird Lane.

    Also, you did not answer:
    Would B2's path already exist?

Posting Permissions

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