<?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: Capture Deleted Rows</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Igor</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-58058</link>
		<dc:creator>Igor</dc:creator>
		<pubDate>Fri, 28 Jan 2011 16:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-58058</guid>
		<description>&lt;p&gt;IN THE END; ENDED UP USING:&lt;/p&gt;
&lt;p&gt;Public glOldRows As Long&lt;br&gt;
Private Sub Worksheet_Activate()&lt;/p&gt;
&lt;p&gt;glOldRows = DataBase.Range(&quot;ZONAAA&quot;).Rows.count&lt;/p&gt;
&lt;p&gt;Private Sub Worksheet_Change(ByVal Target As Range)&lt;br&gt;
Dim Rng1 As Range&lt;br&gt;
Dim RngValue&lt;br&gt;
Set Rng1 = Range(&quot;ZONAAA&quot;)&lt;/p&gt;
&lt;p&gt;If Rng1.Rows.count  glOldRows Then&lt;br&gt;
MsgBox &quot;¡No se pueden modificar las filas!&quot;&lt;br&gt;
Application.EnableEvents = False&lt;br&gt;
Application.Undo&lt;br&gt;
Application.EnableEvents = True&lt;br&gt;
Exit Sub&lt;br&gt;
End If&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>IN THE END; ENDED UP USING:</p>
<p>Public glOldRows As Long<br />
Private Sub Worksheet_Activate()</p>
<p>glOldRows = DataBase.Range(&#8220;ZONAAA&#8221;).Rows.count</p>
<p>Private Sub Worksheet_Change(ByVal Target As Range)<br />
Dim Rng1 As Range<br />
Dim RngValue<br />
Set Rng1 = Range(&#8220;ZONAAA&#8221;)</p>
<p>If Rng1.Rows.count  glOldRows Then<br />
MsgBox &#8220;¡No se pueden modificar las filas!&#8221;<br />
Application.EnableEvents = False<br />
Application.Undo<br />
Application.EnableEvents = True<br />
Exit Sub<br />
End If</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Igor</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-58054</link>
		<dc:creator>Igor</dc:creator>
		<pubDate>Fri, 28 Jan 2011 16:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-58054</guid>
		<description>&lt;p&gt;I used this to disable row adding/deleting:&lt;/p&gt;
&lt;p&gt;Private Sub Worksheet_Change(ByVal Target As Range)&lt;/p&gt;
&lt;p&gt;Dim Rng1 As Range&lt;br&gt;
Set Rng1 = Range(&quot;ZONADATOS&quot;).Resize&lt;/p&gt;
&lt;p&gt;If Rng1.Rows.Count + 1 Then&lt;br&gt;
MsgBox &quot;¡cant add rows!&quot;&lt;br&gt;
Application.EnableEvents = False&lt;br&gt;
Application.Undo&lt;br&gt;
Application.EnableEvents = True&lt;br&gt;
Exit Sub&lt;br&gt;
Else&lt;br&gt;
If Rng1.Rows.Count - 1 Then&lt;br&gt;
MsgBox &quot;¡cant delete rows!&quot;&lt;br&gt;
Application.EnableEvents = False&lt;br&gt;
Application.Undo&lt;br&gt;
Application.EnableEvents = True&lt;br&gt;
Exit Sub&lt;br&gt;
End If&lt;br&gt;
End If&lt;br&gt;
end sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I used this to disable row adding/deleting:</p>
<p>Private Sub Worksheet_Change(ByVal Target As Range)</p>
<p>Dim Rng1 As Range<br />
Set Rng1 = Range(&#8220;ZONADATOS&#8221;).Resize</p>
<p>If Rng1.Rows.Count + 1 Then<br />
MsgBox &#8220;¡cant add rows!&#8221;<br />
Application.EnableEvents = False<br />
Application.Undo<br />
Application.EnableEvents = True<br />
Exit Sub<br />
Else<br />
If Rng1.Rows.Count &#8211; 1 Then<br />
MsgBox &#8220;¡cant delete rows!&#8221;<br />
Application.EnableEvents = False<br />
Application.Undo<br />
Application.EnableEvents = True<br />
Exit Sub<br />
End If<br />
End If<br />
end sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Run macro on column insert or delete</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-43980</link>
		<dc:creator>Run macro on column insert or delete</dc:creator>
		<pubDate>Mon, 15 Feb 2010 23:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-43980</guid>
		<description>&lt;p&gt;[...]  There are no explicit methods for this.  You can take a look here for some workaround methods.  Daily Dose of Excel Blog Archive Capture Deleted Rows  Thanks Al     __________________ [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...]  There are no explicit methods for this.  You can take a look here for some workaround methods.  Daily Dose of Excel Blog Archive Capture Deleted Rows  Thanks Al     __________________ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jairam</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-34080</link>
		<dc:creator>Jairam</dc:creator>
		<pubDate>Wed, 06 Aug 2008 09:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-34080</guid>
		<description>&lt;p&gt;Hey Bob,&lt;/p&gt;
&lt;p&gt;Did you get a response to your query regarding excel 2007 on any other forum? Or did you figure it out?&lt;/p&gt;
&lt;p&gt;Thanks&lt;br&gt;
-Jairam&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey Bob,</p>
<p>Did you get a response to your query regarding excel 2007 on any other forum? Or did you figure it out?</p>
<p>Thanks<br />
-Jairam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bob</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-31223</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Fri, 07 Mar 2008 21:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-31223</guid>
		<description>&lt;p&gt;What about the new 2007 ribbon?  This doesn&#039;t trap the event when clicking the Home -&gt; Delete ribbon button.  Any ideas on this?&lt;/p&gt;
&lt;p&gt;- Bob&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>What about the new 2007 ribbon?  This doesn&#8217;t trap the event when clicking the Home -&gt; Delete ribbon button.  Any ideas on this?</p>
<p>- Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BalintN</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-30234</link>
		<dc:creator>BalintN</dc:creator>
		<pubDate>Thu, 31 Jan 2008 14:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-30234</guid>
		<description>&lt;p&gt;Hello Everyone,&lt;/p&gt;
&lt;p&gt;First of all, thanks for all your comments, I learned a lot.&lt;/p&gt;
&lt;p&gt;One comment to Dick&#039;s first method (you know the one where you check events after they happen), and which has the major drawback of not being able to prevent them.&lt;/p&gt;
&lt;p&gt;You can actually make it right by simply rejecting any change that you don&#039;t explicitly allow.&lt;/p&gt;
&lt;p&gt;The code to do that:&lt;/p&gt;
&lt;p&gt;Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)&lt;br&gt;
    Dim TargetWs As Worksheet&lt;br&gt;
    Set TargetWs = Sh&lt;/p&gt;
&lt;p&gt;    If( ... &#039; I don&#039;t like what the user is doing... ) Then&lt;br&gt;
        Application.EnableEvents = False&lt;br&gt;
        Application.Undo&lt;br&gt;
        Application.EnableEvents = True&lt;br&gt;
    End If&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;This method also has a downside. If some code runs in the meantime that clears the undo buffer, the undo fails.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br&gt;
Balint&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hello Everyone,</p>
<p>First of all, thanks for all your comments, I learned a lot.</p>
<p>One comment to Dick&#8217;s first method (you know the one where you check events after they happen), and which has the major drawback of not being able to prevent them.</p>
<p>You can actually make it right by simply rejecting any change that you don&#8217;t explicitly allow.</p>
<p>The code to do that:</p>
<p>Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)<br />
    Dim TargetWs As Worksheet<br />
    Set TargetWs = Sh</p>
<p>    If( &#8230; &#8216; I don&#8217;t like what the user is doing&#8230; ) Then<br />
        Application.EnableEvents = False<br />
        Application.Undo<br />
        Application.EnableEvents = True<br />
    End If<br />
End Sub</p>
<p>This method also has a downside. If some code runs in the meantime that clears the undo buffer, the undo fails.</p>
<p>Best regards,<br />
Balint</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-29313</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Mon, 10 Dec 2007 22:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-29313</guid>
		<description>&lt;p&gt;Mark:  You can&#039;t.  There&#039;s no event for it, so you&#039;re stuck polling a different event more times than you need.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Mark:  You can&#8217;t.  There&#8217;s no event for it, so you&#8217;re stuck polling a different event more times than you need.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark L</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-29307</link>
		<dc:creator>Mark L</dc:creator>
		<pubDate>Mon, 10 Dec 2007 18:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-29307</guid>
		<description>&lt;p&gt;I have looked through most of these examples; they are all good but I am not sure that I still see wht I am after. &lt;/p&gt;
&lt;p&gt;I am working with some named ranges.&lt;/p&gt;
&lt;p&gt;On my change event, I have some code that looks like this:&lt;/p&gt;
&lt;p&gt;Private Sub Worksheet_Change(ByVal Target As Range)&lt;/p&gt;
&lt;p&gt;Dim Rng1 As Range&lt;/p&gt;
&lt;p&gt;Set Rng1 = Range(&quot;Sh1billsW&quot;).Resize&lt;/p&gt;
&lt;p&gt;If Rng1.Rows.Count + 1 Then&lt;br&gt;
 MsgBox &quot;Row Added&quot;&lt;br&gt;
 MsgBox &quot;Number of Rows = &quot; &amp; Rng1.Rows.Count&lt;br&gt;
Else&lt;br&gt;
If Rng1.Rows.Count - 1 Then&lt;br&gt;
 MsgBox &quot;Row Deleted&quot;&lt;br&gt;
 Exit Sub&lt;br&gt;
End If&lt;br&gt;
End If&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;It is almost there.&lt;br&gt;
If I add or delete a row, it does return the proper row count in the named range.&lt;br&gt;
However, anytime I do anything in the worksheet, it still runs that code.&lt;br&gt;
I only want the code to run in the (event) that a row is inserted or deleted&lt;/p&gt;
&lt;p&gt;Any ideas? &lt;/p&gt;
&lt;p&gt;Thanks&lt;br&gt;
Mark&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I have looked through most of these examples; they are all good but I am not sure that I still see wht I am after. </p>
<p>I am working with some named ranges.</p>
<p>On my change event, I have some code that looks like this:</p>
<p>Private Sub Worksheet_Change(ByVal Target As Range)</p>
<p>Dim Rng1 As Range</p>
<p>Set Rng1 = Range(&#8220;Sh1billsW&#8221;).Resize</p>
<p>If Rng1.Rows.Count + 1 Then<br />
 MsgBox &#8220;Row Added&#8221;<br />
 MsgBox &#8220;Number of Rows = &#8221; &amp; Rng1.Rows.Count<br />
Else<br />
If Rng1.Rows.Count &#8211; 1 Then<br />
 MsgBox &#8220;Row Deleted&#8221;<br />
 Exit Sub<br />
End If<br />
End If</p>
<p>End Sub</p>
<p>It is almost there.<br />
If I add or delete a row, it does return the proper row count in the named range.<br />
However, anytime I do anything in the worksheet, it still runs that code.<br />
I only want the code to run in the (event) that a row is inserted or deleted</p>
<p>Any ideas? </p>
<p>Thanks<br />
Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig Carlson</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-24237</link>
		<dc:creator>Craig Carlson</dc:creator>
		<pubDate>Tue, 22 May 2007 00:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-24237</guid>
		<description>&lt;p&gt;Interesting problem...&lt;/p&gt;
&lt;p&gt;My solution is a little restrictive, but if you have a defined  range (not necessarily named, but just a critical area)that you want to monitor, fill an unused adjacent range (Column if rows are of interest, and vice versa for columns) with numbers, and examine the sum.  If the sum is different after the change event fires, you can [carefully] assume the row (or column) was deleted, and proceed with the msgbox and undo.  There may be some holes in this scheme, but it works in my limited case.  I hide the column that contains the numbers to avoid prying eyes...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Interesting problem&#8230;</p>
<p>My solution is a little restrictive, but if you have a defined  range (not necessarily named, but just a critical area)that you want to monitor, fill an unused adjacent range (Column if rows are of interest, and vice versa for columns) with numbers, and examine the sum.  If the sum is different after the change event fires, you can [carefully] assume the row (or column) was deleted, and proceed with the msgbox and undo.  There may be some holes in this scheme, but it works in my limited case.  I hide the column that contains the numbers to avoid prying eyes&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Glancy</title>
		<link>http://www.dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/#comment-20982</link>
		<dc:creator>Doug Glancy</dc:creator>
		<pubDate>Tue, 19 Sep 2006 23:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1484#comment-20982</guid>
		<description>&lt;p&gt;Juan Pablo,&lt;/p&gt;
&lt;p&gt;Thanks.  What I am trying to do is enable the Data&gt;Filter&gt;AutoFilter button.  What is described above seems to be the pre-2002 version of Protect AllowFiltering := True, which I&#039;m using (in XL 03).  Both of these seem to allow the user to use a filter that&#039;s already set, but not to set and unset a Filter, i.e, click on the AutoFilter button.  Of course, I&#039;m probably just not understanding, so please help me out. :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Juan Pablo,</p>
<p>Thanks.  What I am trying to do is enable the Data&gt;Filter&gt;AutoFilter button.  What is described above seems to be the pre-2002 version of Protect AllowFiltering := True, which I&#8217;m using (in XL 03).  Both of these seem to allow the user to use a filter that&#8217;s already set, but not to set and unset a Filter, i.e, click on the AutoFilter button.  Of course, I&#8217;m probably just not understanding, so please help me out. <img src='http://www.dailydoseofexcel.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

