+ Reply to Thread
Results 1 to 3 of 3

Renaming files in bulk

  1. #1
    Registered User
    Join Date
    05-19-2015
    Location
    lisbon, portugal
    MS-Off Ver
    2007
    Posts
    10

    Renaming files in bulk

    Hi all,

    I am trying to create a macro that will rename all files in column A according to the names in column B. Let us assume that names already include the full path and are not necessarily in the same folders such as:
    • Column A - C:\Users\me\Desktop\Experience\A1.docx (without "")
    • Column B - C:\Users\me\Desktop\Experience\B1.docx (without "")

    I would like to do something like this:

    Please Login or Register  to view this content.
    All inputs are appreciated. As you can see, I'm admittedly a beginner.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Renaming files in bulk

    Hello lordmgls,

    Here is a bit of info from the VBA Help files about the Name statement:
    The Name statement renames a file and moves it to a different directory or folder, if necessary. Name can move a file across drives, but it can only rename an existing directory or folder when both newpathname and oldpathname are located on the same drive. Name cannot create a new file, directory, or folder.
    You code looks like it should work. Have you tried running it?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-19-2015
    Location
    lisbon, portugal
    MS-Off Ver
    2007
    Posts
    10

    Re: Renaming files in bulk

    Hi Leith,

    Thanks for the content. It does work indeed - not sure what happened yesterday. May I take the chance to ask for your help taking this a bit further: what would be an alternative to the Name statement in order to create new files/ directories as required by column B inputs? I have made slight changes:

    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. Bulk print files in folder
    By gach in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-05-2019, 07:23 AM
  2. Replies: 1
    Last Post: 02-02-2017, 06:05 PM
  3. VB Code to email bulk of files
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-31-2015, 07:11 AM
  4. Bulk Renaming: multiple Subtitute or Subtitute with Index & Match?
    By s7upid in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-03-2014, 05:42 AM
  5. [SOLVED] Bulk Find and Replace in 500 files
    By yossel in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-17-2014, 12:27 PM
  6. Best Way to Bulk Import a Few Hundred CSV Files
    By Videoman22 in forum Access Tables & Databases
    Replies: 0
    Last Post: 07-06-2013, 04:29 PM
  7. bulk renaming picture file with excel 2010
    By monteiro1969 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2013, 05:23 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