View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Excel & pictures

Hi Neil

If you have a member list in Column A of "Sheet1"
You can loop through the pictures in the sheet "shapes" and check if the filename match a member.

this macro delete all pictures that match the member list

Sub ShapesTest()
'Loop through the Shapes collection and use the Type number of the control
Dim myshape As Shape
For Each myshape In Sheets("shapes").Shapes
'13 =Picture
If myshape.Type = 13 Then
If Not IsError(Application.Match(myshape.Name, _
Sheets("Sheet1").Columns("A"), 0)) Then
myshape.Delete
End If
End If
Next myshape
End Sub

--
Regards Ron de Bruin
http://www.rondebruin.nl



"neil" 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
--
neil