+ Reply to Thread
Results 1 to 3 of 3

cut and paste images from filename

Hybrid View

  1. #1
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    cut and paste images from filename

    i have excel where in column A contain filename of jpg files i.e. 10001.jpg, 10002.jpg and i have folder that contain lot of images.
    Now i want cut only that images which i put in excel file column A and paste it another folder.
    pls help me
    Last edited by mohan.r1980; 10-06-2010 at 01:15 AM.

  2. #2
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: cut and paste images from filename

    Bump no response

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: cut and paste images from filename

    Try this...

    Sub Test()
    Const FileCol = 1
    Const FirstDataRow = 1
    
    Const SourcePath = "c:\temp\"
    Const TargetPath = "c:\temp\test\"
    
    Dim LastRow, RowLoop As Range
    
    With ThisWorkbook.Sheets(1)
      LastRow = .Cells(.Rows.Count, FileCol).End(xlUp).Row
      
      For Each RowLoop In Range(Cells(FirstDataRow, FileCol), Cells(LastRow, FileCol)).Cells
        If RowLoop.Value <> "" Then
          If Dir(SourcePath & RowLoop.Value) <> "" Then
            FileCopy SourcePath & RowLoop.Value, TargetPath & RowLoop.Value
          End If
        End If
      Next RowLoop
    
      MsgBox "Finished file copy"
      
    End With
         
    End Sub

+ 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