ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Select If... (https://www.excelbanter.com/excel-programming/358023-select-if.html)

alenhart[_2_]

Select If...
 
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!


alenhart[_2_]

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


Jim Thomlinson

Select If...
 
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

--
HTH...

Jim Thomlinson


"alenhart" wrote:

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!



alenhart[_2_]

Select If...
 
Perfect.
Thank you so much!



All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com