Hi,
how can I delete symbols in the row 52 and 53 in the attached file ?
regards
Hi,
how can I delete symbols in the row 52 and 53 in the attached file ?
regards
Run this bit of code.
[vba] For Each shp In ActiveSheet.Shapes
shp.Delete
Next shp
[/vba]
can I delete without code ?
with code it deletes all of them not only the shape in row 52 and 53
Try
[VBA]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
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
hi,
runtime error 1004
application-defined or object-defined error
what is the problem ?
On what line does the error occur?
Here's a slight modification to help show where the shapes are found
[VBA]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
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
hi,
B53 becomes yellow.message says 26 then gives same error.
error line is shp.Delete
regards
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.
[VBA]shp.TopLeftCell.Interior.ColorIndex = 6
MsgBox ActiveSheet.Shapes.Count
shp.Delete
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
hi,
I could not solve the problem. please check the attached file. I want to delete the shapes in 52 and 53
regards
Try unprotecting the sheet.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'