I made a different assumption about where the pictures are.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
Sub CopyCurrentPictureFiles()
'Jim Cone San Francisco, USA October 2006
'Copies files in worksheet list to another folder.
Dim strFromPath As String
Dim strToPath As String
Dim strName As String
Dim rngCell As Excel.Range
Dim rngList As Excel.Range
Dim Fso As Object
Set Fso = CreateObject("Scripting.FileSystemObject")
'User must select the list of good pictures before running this code.
'Names in list must exactly match the file names in the directory/folder.
Set rngList = Selection
'File path to the folder with the pictures.
strFromPath = "C:\Documents and Settings\My Documents\My Pictures\"
'User must create a new folder before running this code.
strToPath = "C:\Documents and Settings\My Documents\My Current Pictures\"
'Copies files to the new folder.
For Each rngCell In rngList
strName = rngCell.Value
'False prevents overwriting of files
On Error Resume Next
Fso.CopyFile strFromPath & strName, strToPath & strName, False
On Error GoTo 0
Next 'rngCell
'Technically not required, but I prefer it.
Set Fso = Nothing
Set rngCell = Nothing
Set rngList = Nothing
End Sub
'--------------
"neil" <
[email protected]>
wrote in message
I have an excel spereadsheet containing information about members of a club
which is maintained and a folder with pictures of all members including those
who left some years ago. I have 2,000 members in excel but some 4,000
pictures, the file name of the picture matches the membership number, how do
I delete the obsolete member pictures automatically without manually do it?
tia