+ Reply to Thread
Results 1 to 7 of 7

VBA Batch Rename Large Amount of Images

  1. #1
    Registered User
    Join Date
    04-25-2013
    Location
    Williamsburg, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    10

    VBA Batch Rename Large Amount of Images

    Hi,

    I am looking for a way to batch rename a large set of image files using VBA. I have an Excel sheet with the old name in column 1 and the new in column 2. I have seen some utilities listed here, but sadly the security at the company prohibits us from using all but approved programs. I have a very basic understanding of VBA, and I think this falls well outside it.

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA Batch Rename Large Amount of Images

    http://stackoverflow.com/questions/7...with-excel-vba

  3. #3
    Registered User
    Join Date
    04-25-2013
    Location
    Williamsburg, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Batch Rename Large Amount of Images

    This looks perfect. Would I run it as a formula or save it as a macro? Again, I have a VERY basic understanding.

  4. #4
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: VBA Batch Rename Large Amount of Images

    Save it as a macro.

  5. #5
    Registered User
    Join Date
    04-25-2013
    Location
    Williamsburg, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Batch Rename Large Amount of Images

    I am receiving the error "Compile Error: Invalid Outside Procedure". It then highlights "Set" in "Set Source"

    Dim Source As Range
    Dim OldFile As String
    Dim NewFile As String

    Set Source = Cells(1, 1).CurrentRegion

    For Row = 1 To Source.Rows.Count
    OldFile = ActiveSheet.Cells(Row, 1)
    NewFile = ActiveSheet.Cells(Row, 2)

    ' rename files
    Name OldFile As NewFile

    Next
    Last edited by NPoorbaugh; 04-25-2013 at 12:05 PM.

  6. #6
    Registered User
    Join Date
    04-25-2013
    Location
    Williamsburg, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Batch Rename Large Amount of Images

    Would it help if I loaded a picture of the error and the way I have the code situated?

  7. #7
    Registered User
    Join Date
    04-25-2013
    Location
    Williamsburg, Virginia
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA Batch Rename Large Amount of Images

    Never mind, I got it to work. Thanks! This is perfect!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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