<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: VBA: Delete All Autoshapes</title>
	<atom:link href="http://www.automateexcel.com/2004/11/29/excel_vba_delete_all_autoshapes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.automateexcel.com/2004/11/29/excel_vba_delete_all_autoshapes/</link>
	<description>Hundreds of Excel Tips &#38; Tricks</description>
	<lastBuildDate>Wed, 10 Mar 2010 07:03:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.automateexcel.com/2004/11/29/excel_vba_delete_all_autoshapes/comment-page-1/#comment-47</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Thu, 02 Dec 2004 00:10:45 +0000</pubDate>
		<guid isPermaLink="false">#comment-47</guid>
		<description>Hi.&lt;br /&gt;
&lt;br /&gt;
Along a similar line.&lt;br /&gt;
I built this code to delete shapes within a given range.&lt;br /&gt;
&lt;br /&gt;
Setting cDeleteOnTouch to True has a different effect.&lt;br /&gt;
ie. Range is just touching or range fully covers shape?&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;br /&gt;
Sub test()&lt;br /&gt;
    Const cDeleteOnTouch As Boolean = False&lt;br /&gt;
    Dim rng As Range, shp As Shape, rngSelect As Range, blnDelete As Boolean&lt;br /&gt;
&lt;br /&gt;
    Set rngSelect = Selection&lt;br /&gt;
&lt;br /&gt;
    For Each shp In ActiveSheet.Shapes&lt;br /&gt;
        blnDelete = False&lt;br /&gt;
        Set rng = Intersect(Range(shp.TopLeftCell, shp.BottomRightCell), rngSelect)&lt;br /&gt;
        If cDeleteOnTouch Then&lt;br /&gt;
            If Not rng Is Nothing Then blnDelete = True&lt;br /&gt;
        Else&lt;br /&gt;
            If Not rng Is Nothing Then&lt;br /&gt;
                If rng.Address = Range(shp.TopLeftCell, shp.BottomRightCell).Address Then blnDelete = True&lt;br /&gt;
            End If&lt;br /&gt;
        End If&lt;br /&gt;
&lt;br /&gt;
        If blnDelete Then&lt;br /&gt;
            MsgBox &quot;delete &quot; &amp; shp.Name&lt;br /&gt;
            &#039;shp.Delete&lt;br /&gt;
        End If&lt;br /&gt;
    Next&lt;br /&gt;
End Sub&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi.</p>
<p>Along a similar line.<br />
I built this code to delete shapes within a given range.</p>
<p>Setting cDeleteOnTouch to True has a different effect.<br />
ie. Range is just touching or range fully covers shape?</p>
<pre>
Sub test()
    Const cDeleteOnTouch As Boolean = False
    Dim rng As Range, shp As Shape, rngSelect As Range, blnDelete As Boolean

    Set rngSelect = Selection

    For Each shp In ActiveSheet.Shapes
        blnDelete = False
        Set rng = Intersect(Range(shp.TopLeftCell, shp.BottomRightCell), rngSelect)
        If cDeleteOnTouch Then
            If Not rng Is Nothing Then blnDelete = True
        Else
            If Not rng Is Nothing Then
                If rng.Address = Range(shp.TopLeftCell, shp.BottomRightCell).Address Then blnDelete = True
            End If
        End If

        If blnDelete Then
            MsgBox "delete " &amp; shp.Name
            'shp.Delete
        End If
    Next
End Sub</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
