Select If...

A

alenhart

I have a problem (to say the least). I have a document which contains
something like 2000 images, a number of which have been distorted until
they are invisible. I can only see the images when I run the macro to
select all the images, and then I see the corner indicators. I need a
way to select and delete ONLY these invisible images

I feel like I have an edge, as all images I want to keep have a pixel
height of greater than 60.

I am not really good with VBA (I know enough to get me in trouble, not
enough to be productive). Any help you could give me would be greately
appreciated.

Thank you!
 
A

alenhart

Perhaps a better way to explain the difference is that all these images
have a width of 0
 
G

Guest

Give this a try... It goes through all of the sheets and deletes any shapes
where the height is less than 60.

Sub DeleteShapes()
Dim shp As Shape
Dim wks As Worksheet

For Each wks In Worksheets
For Each shp In wks.Shapes
If shp.Height < 60 Then shp.Delete
Next shp
Next wks

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top