Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete drwaings in a centain selection
I try to delete all the drawings in a certain selection.
sub deletedrawings() Range("A60:H60").Select Range("H60").Activate Range(Selection, Selection.End(xlDown)).Select activecells.DrawingObjects(1).Delete Selection.ClearContents end sub But I get an error with the line activecells.DrawingObjects(1).Delete |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete drwaings in a centain selection
Bartman,
Try something like the sub below. HTH, Bernie MS Excel MVP Sub DeleteShapes() Dim myRange As Range Dim myTop As Double Dim myLeft As Double Dim myRight As Double Dim myBottom As Double Dim mySh As Shape Set myRange = Range(Range("A60"), Range("H60").End(xlDown)) myTop = myRange(1).Top myLeft = myRange(1).Left myRight = myRange(myRange.Count).Left + myRange(myRange.Count).Width myBottom = myRange(myRange.Count).Top + myRange(myRange.Count).Height For Each mySh In ActiveSheet.Shapes If mySh.Top myTop And mySh.Top < myBottom Then If mySh.Left myLeft And mySh.Left < myRight Then mySh.Delete End If End If Next mySh End Sub "bartman1980" wrote in message oups.com... I try to delete all the drawings in a certain selection. sub deletedrawings() Range("A60:H60").Select Range("H60").Activate Range(Selection, Selection.End(xlDown)).Select activecells.DrawingObjects(1).Delete Selection.ClearContents end sub But I get an error with the line activecells.DrawingObjects(1).Delete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
delete a selection | Charts and Charting in Excel | |||
Problem of selection.delete | Excel Worksheet Functions | |||
Copy Selection - Paste Selection - Delete Selection | Excel Programming | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Delete blank rows in selection | Excel Programming |