Erase/clear images/pictures pasted into a worksheet

  • Thread starter Thread starter Scott Lyon
  • Start date Start date
S

Scott Lyon

There are times that I need to do a cut & paste of a table on a web page,
and drop that data right into Excel for processing.


The only thing, is sometimes some cells have hyperlinks (which I'm able to
remove), and some cells have pictures (in addition to text).

Is there any way I can globally remove all pictures/images inserted into an
Excel worksheet, short of right-clicking on each one and selecting "Cut"?


Thanks!
-Scott
 
These may help.

Sub HyperlinksOut()
ActiveSheet.Hyperlinks.Delete
End Sub
Sub ShapesCut()
For Each S In ActiveSheet.Shapes
S.Cut
Next
End Sub
'or
Sub shapescut1() 'Tom Ogilvy
ActiveSheet.Shapes.SelectAll
Selection.Delete
End Sub
Sub ShapesALLinWorkbookDelete() 'Deletes all in WORKBOOK
Dim sh As Worksheet
For Each sh In ActiveWorkbook.Worksheets
sh.DrawingObjects.Delete
Next sh
End Sub
Sub ShapesInRangeDelete() 'Iain
Dim shpLoop As Shape
Set rngUsable = Range("e1:e24")
For Each shpLoop In ActiveSheet.Shapes
'does the top left corner of the shape overlap rngUsable?
If Not (Application.Intersect(rngUsable, shpLoop.TopLeftCell) Is Nothing)
Then
shpLoop.Delete
End If
Next shpLoop
End Sub
Sub RemoveObjectsFromSelection() 'Jake Marx MVP
Dim ole As OLEObject
Dim shp As Shape

For Each ole In Selection.Parent.OLEObjects
If Not Application.Intersect(Selection, _
ole.TopLeftCell) Is Nothing Then
ole.Delete
End If
Next ole

For Each shp In Selection.Parent.Shapes
If Not Application.Intersect(Selection, _
shp.TopLeftCell) Is Nothing Then
shp.Delete
End If
Next shp
End Sub
 
Beware that all objects will go:-

Edit / Go To / Special / Objects - Hit the delete key.
 
Back
Top