+ Reply to Thread
Results 1 to 3 of 3

VB Code to rename the folder

  1. #1
    Valued Forum Contributor
    Join Date
    01-18-2007
    Location
    Georgia
    MS-Off Ver
    2010
    Posts
    4,361

    VB Code to rename the folder

    Hello:

    Folder Name : XYZ

    I Need VB Code to go thru C:\Temp and all of its subfolders to find Folder Named XYZ and change the name to ABC

    Please let me know if you have any questions.
    Thanks.

    Riz

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2019
    Posts
    6,593

    Re: VB Code to rename the folder

    I don't have any questions ... you do
    Try here
    https://debugvba.com/rename-folder-o...-debugvba-com/
    and if you're still stuck ... we'll pitch in
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Guru
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,859

    Re: VB Code to rename the folder

    Hi rizmomin,

    Try the following code contained in the attached sample file. This uses a technique called recursion. This particular macro will replace the first SubFolder found ONLY, which may reside in a lower level SubFolder. There is another Macro in the sample file that will replace all matches.
    Please Login or Register  to view this content.
    Lewis

+ 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. [SOLVED] VBA Macros to Rename Sub Folder with ID
    By E5254730 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-17-2020, 03:31 AM
  2. Rename .pdf files in a folder
    By vijanand1279 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-11-2019, 01:11 AM
  3. [SOLVED] VB Code to rename the files in a folder
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-24-2018, 09:53 PM
  4. [SOLVED] Disable folder rename
    By sintek in forum Microsoft Windows Help
    Replies: 2
    Last Post: 11-29-2016, 01:43 AM
  5. Disable folder rename
    By sintek in forum Excel General
    Replies: 0
    Last Post: 11-28-2016, 10:55 AM
  6. [SOLVED] VBA Code to save to a folder within a folder within a folder all based on cell values.
    By sintek in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-24-2016, 04:24 PM
  7. [SOLVED] rename files in a folder
    By Varun Nair in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-18-2006, 05:05 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