<?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: Disabling Events In Userforms</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/06/08/disabling-events-in-userforms/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/06/08/disabling-events-in-userforms/</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: Chris Christianson</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/08/disabling-events-in-userforms/#comment-30817</link>
		<dc:creator>Chris Christianson</dc:creator>
		<pubDate>Tue, 19 Feb 2008 21:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=613#comment-30817</guid>
		<description>&lt;p&gt;Excellent solution to a difficult problem.  Thanks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Excellent solution to a difficult problem.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paramasivan</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/08/disabling-events-in-userforms/#comment-15907</link>
		<dc:creator>Paramasivan</dc:creator>
		<pubDate>Wed, 14 Sep 2005 10:58:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=613#comment-15907</guid>
		<description>&lt;p&gt;The code you have given is helpful for the listbox if you are making teh changes in other list box.&lt;/p&gt;
&lt;p&gt;But it is not working fine if the changes are made within the same listbox.&lt;/p&gt;
&lt;p&gt;I want to change the selection of the Listbox1 within the ListBox1_Click or ListBox1_Change.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The code you have given is helpful for the listbox if you are making teh changes in other list box.</p>
<p>But it is not working fine if the changes are made within the same listbox.</p>
<p>I want to change the selection of the Listbox1 within the ListBox1_Click or ListBox1_Change.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/08/disabling-events-in-userforms/#comment-9139</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Fri, 04 Mar 2005 10:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=613#comment-9139</guid>
		<description>&lt;p&gt;Wonderfull - I&#039;d been trying to deal with this for a while (in my case altering a listbox when the selection in the listbox is changed). Problem solved in 30 seconds...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Wonderfull &#8211; I&#8217;d been trying to deal with this for a while (in my case altering a listbox when the selection in the listbox is changed). Problem solved in 30 seconds&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/08/disabling-events-in-userforms/#comment-1693</link>
		<dc:creator>Dick</dc:creator>
		<pubDate>Wed, 09 Jun 2004 14:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=613#comment-1693</guid>
		<description>&lt;p&gt;Jamie:  I&#039;ve always hated how my method was backward.  The extra coding is nothing compared to the extra thinking I have to do every time I use mine.  Thanks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jamie:  I&#8217;ve always hated how my method was backward.  The extra coding is nothing compared to the extra thinking I have to do every time I use mine.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Collins</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/06/08/disabling-events-in-userforms/#comment-1692</link>
		<dc:creator>Jamie Collins</dc:creator>
		<pubDate>Wed, 09 Jun 2004 11:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=613#comment-1692</guid>
		<description>&lt;p&gt;I use a slightly different approach. I want my code to assume that events are enabled by default. I only disable events when I want to temporarily prevent an event from firing, e.g. when manipulating a control programmatically, after which events are re-enabled. Additionally, I always test whether events are enabled at the top of all event handlers. So:&lt;/p&gt;
&lt;p&gt;Option Explicit&lt;/p&gt;
&lt;p&gt;Dim mbEvents As Boolean&lt;/p&gt;
&lt;p&gt;Private Sub UserForm_Initialize()&lt;br&gt;
mbEvents = True&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox1_Change()&lt;br&gt;
If Not mbEvents Then Exit Sub&lt;br&gt;
mbEvents = False&lt;br&gt;
TextBox2.Text = Me.TextBox1.Text&lt;br&gt;
mbEvents = True&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox2_Change()&lt;br&gt;
If Not mbEvents Then Exit Sub&lt;br&gt;
MsgBox TextBox2.Text&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;It requires a slightly more coding but I find it more intuitive because it follows Excel&#039;s Application.EnableEvents logic and avoids the &#039;converse boolean name&#039; situation e.g. &lt;/p&gt;
&lt;p&gt;  If Not mbNotEnabled Then&lt;/p&gt;
&lt;p&gt;&#039;cos my brain is too simple!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I use a slightly different approach. I want my code to assume that events are enabled by default. I only disable events when I want to temporarily prevent an event from firing, e.g. when manipulating a control programmatically, after which events are re-enabled. Additionally, I always test whether events are enabled at the top of all event handlers. So:</p>
<p>Option Explicit</p>
<p>Dim mbEvents As Boolean</p>
<p>Private Sub UserForm_Initialize()<br />
mbEvents = True<br />
End Sub</p>
<p>Private Sub TextBox1_Change()<br />
If Not mbEvents Then Exit Sub<br />
mbEvents = False<br />
TextBox2.Text = Me.TextBox1.Text<br />
mbEvents = True<br />
End Sub</p>
<p>Private Sub TextBox2_Change()<br />
If Not mbEvents Then Exit Sub<br />
MsgBox TextBox2.Text<br />
End Sub</p>
<p>It requires a slightly more coding but I find it more intuitive because it follows Excel&#8217;s Application.EnableEvents logic and avoids the &#8216;converse boolean name&#8217; situation e.g. </p>
<p>  If Not mbNotEnabled Then</p>
<p>&#8216;cos my brain is too simple!</p>
<p></p>
]]></content:encoded>
	</item>
</channel>
</rss>

