View Full Version : DELETING SYMBOLS
Hi,
how can I delete symbols in the row 52 and 53 in the attached file ?
regards
Bob Phillips
04-11-2007, 02:14 PM
Run this bit of code.
For Each shp In ActiveSheet.Shapes
shp.Delete
Next shp
can I delete without code ?
with code it deletes all of them not only the shape in row 52 and 53
mdmackillop
04-13-2007, 03:02 PM
Try
Sub DelShapes()
For Each shp In ActiveSheet.Shapes
If shp.TopLeftCell.Row = 52 Or shp.TopLeftCell.Row = 53 Then
shp.Delete
End If
Next shp
End Sub
hi,
runtime error 1004
application-defined or object-defined error
what is the problem ?
mdmackillop
04-14-2007, 07:52 AM
On what line does the error occur?
Here's a slight modification to help show where the shapes are found
Option Explicit
Sub DelShapes()
Dim shp As Shape
MsgBox ActiveSheet.Shapes.Count
For Each shp In ActiveSheet.Shapes
shp.TopLeftCell.Interior.ColorIndex = 7
If shp.TopLeftCell.Row = 52 Or shp.TopLeftCell.Row = 53 _
Or shp.TopLeftCell.Row = 54 Then
shp.TopLeftCell.Interior.ColorIndex = 6
shp.Delete
End If
Next shp
MsgBox ActiveSheet.Shapes.Count
End Sub
hi,
B53 becomes yellow.message says 26 then gives same error.
error line is shp.Delete
regards
mdmackillop
04-14-2007, 09:31 AM
:dunno I can't replicate the error. The yellow cell shows a shape has been found. You could try changing the code a bit to see in any shapes are deleted.
shp.TopLeftCell.Interior.ColorIndex = 6
MsgBox ActiveSheet.Shapes.Count
shp.Delete
hi,
I could not solve the problem. please check the attached file. I want to delete the shapes in 52 and 53
regards
mdmackillop
04-14-2007, 02:46 PM
Try unprotecting the sheet.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.