ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   delete rows based on cells having a floating pix (https://www.excelbanter.com/excel-programming/356420-delete-rows-based-cells-having-floating-pix.html)

GottaRun

delete rows based on cells having a floating pix
 

Hi,

I have 2 columns. . What I want to do is to delete the rows where th
cells of column B has a picture of a magnifying glass. Autofilte
treted all the cells in B as blank.
zip file containing sample file attached.

thanks for any assist

+-------------------------------------------------------------------
|Filename: Book4.zip
|Download: http://www.excelforum.com/attachment.php?postid=4479
+-------------------------------------------------------------------

--
GottaRu
-----------------------------------------------------------------------
GottaRun's Profile: http://www.excelforum.com/member.php...fo&userid=3129
View this thread: http://www.excelforum.com/showthread.php?threadid=52395


JE McGimpsey

delete rows based on cells having a floating pix
 
I won't open your workbook, for many reasons, including potential virii.
However, this may work for you.

Pictures don't reside in a cell, they reside in the Drawing Layer on top
of cells. This macro will determine which pictures have the name
"magnifying_glass" in them, and delete both the pictures and the rows
that contain the cell over which the picture's top left corner lies.

Public Sub DeleteRowsWithMagnifyingGlasses()
Dim rDelete As Range
Dim picTest As Picture
For Each picTest In ActiveSheet.Pictures
With picTest
Debug.Print .Name
If LCase(.Name) Like "magnifying_glass*" Then
If rDelete Is Nothing Then
Set rDelete = .TopLeftCell
Else
Set rDelete = Union(rDelete, .TopLeftCell)
End If
.Delete
End If
End With
Next picTest
If Not rDelete Is Nothing Then _
rDelete.EntireRow.Delete
End Sub

Modify the picture names to suit.

In article ,
GottaRun
wrote:

Hi,

I have 2 columns. . What I want to do is to delete the rows where the
cells of column B has a picture of a magnifying glass. Autofilter
treted all the cells in B as blank.
zip file containing sample file attached.

thanks for any assist.



All times are GMT +1. The time now is 01:20 PM.

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