+ Reply to Thread
Results 1 to 2 of 2

VBA file naming help

Hybrid View

  1. #1
    Registered User
    Join Date
    08-31-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2007
    Posts
    15

    VBA file naming help

    Hi,
    Does anyone have a good macro, that can lookup .jpg file names listed in Column A and re-name them with file names listed in column B (.jpg files are in one folder and need to be re-named into another folder on my desk top) Column A has unique values but column B may contain duplicates. If duplicate in column B it doesnt matter which image in column A its related to. It just needs to get named once.

    Column A Column B
    outside.jpg -->> rename to 456335.jpg
    pool.jpg -->> rename to 876445.jpg
    sansas.jpg -->> rename to 455434.jpg

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: VBA file naming help

    Something like

        With Activesheet
    
            Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
            For i = 1 To Lastrow
    
                Name .Cells(i, "A").Value2 As .Cells(i, "B").Value2
            Next i
        End With

+ 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