+ Reply to Thread
Results 1 to 5 of 5

Re-naming many excel files in a folder by VBA

  1. #1
    Registered User
    Join Date
    10-21-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re-naming many excel files in a folder by VBA

    Hi Dear All,

    Iam new user of VBA. I need some help. I have hundreds of excel files in one folder. What I want to do is, to rename all of them by there cell values of A5 & A10 & A3 of sheet2*
    *(different files have different names of sheet2)

    for example if one file of excel cell's contains these informations....

    sheet2 (name is hotel)
    A5 (EUROPEAN VVIP Rates)
    A10 (All rates below are USD non commissionable)
    A3 (Updated as on 06/12/2009)

    then that excel file should be renamed as
    "EUROPEAN VVIP Rates USD Updated as on 06/12/2009"

    Note: in A10 i only need currency type which could be any.

    I need VBA which renames all files at onces

    thanks in advance.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Re-naming many excel files in a folder by VBA

    You'll find code to extract all the file names in a folder on my home page. To rename, you need to use the Name ...... As .... construct.

    Remember that there are some characters which are not allowed in file names so you will need to think about the format of the date that you wish to use to avoid slashes.
    Martin

  3. #3
    Registered User
    Join Date
    10-21-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    59

    Re: Re-naming many excel files in a folder by VBA

    Quote Originally Posted by mrice View Post
    You'll find code to extract all the file names in a folder on my home page. To rename, you need to use the Name ...... As .... construct.

    Remember that there are some characters which are not allowed in file names so you will need to think about the format of the date that you wish to use to avoid slashes.
    Thanks Mrice, your VBA codes worked in extracting all files in folder but I couldn't understand how to rename all files. Iam new user so, could you please explain me little in details. Thanks alot for your co-operations

  4. #4
    Valued Forum Contributor JeanRage's Avatar
    Join Date
    03-02-2009
    Location
    Nice, France
    MS-Off Ver
    Excel 2003
    Posts
    705

    Re: Re-naming many excel files in a folder by VBA

    Hi,

    As indicated above, the VBA instruction is
    Name OldName As NewName
    HTH

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Re-naming many excel files in a folder by VBA

    Assuming that you have old and new file names in columns 1 & 2 respectively

    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)

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