Results 1 to 3 of 3

Thread: VBA script help in Excel 2007

  1. #1
    Join Date
    Nov 2008
    Posts
    24

    VBA script help in Excel 2007

    Hi friends, I am using Excel 2007, I have a list of 80 images (All JPG files) on column A which mirror actual file names of files I have located in C:\photos.

    My objective is to use Excel 2007 to batch rename all the files located in C:\photos from the names listed in column "A" to the names listed in column "B" that I have created.

    I need a VBA script that will accomplish this task.
    Thanks.

  2. #2
    Join Date
    May 2008
    Posts
    4,831

    Re: VBA script help in Excel 2007

    Here is a VBA script

    Code:
    Sub y()
        Dim cell As Range
        Const sPath As String = "C:\Photos\"
        
        For Each cell In Range("A1", Range("A1").End(xlDown))
            Name sPath & cell.Text As sPath & cell.Offset(, 1).Text
        Next cell
    End Sub

  3. #3
    Join Date
    Nov 2008
    Posts
    24

    Re: VBA script help in Excel 2007

    Thank you for the script.Script helped me out and saved my time

Similar Threads

  1. Excel 2003 Macro doesn't work in Excel 2007
    By jjaw in forum Windows Software
    Replies: 3
    Last Post: 03-01-2014, 03:28 PM
  2. Excel 2007 file fails to get permission to open in Excel 2011
    By Raju Chacha in forum Windows Software
    Replies: 6
    Last Post: 13-01-2012, 09:17 PM
  3. Replies: 6
    Last Post: 17-05-2011, 10:00 PM
  4. Embedded Excel 2007 workbook gives error in Word 2007.
    By Milo D in forum Windows Software
    Replies: 5
    Last Post: 25-04-2011, 06:56 AM
  5. Retrieve data from Access 2007 to Excel 2007
    By Markesh in forum Windows Software
    Replies: 3
    Last Post: 23-09-2009, 08:20 AM

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
  •  
Page generated in 1,713,875,034.12903 seconds with 17 queries