<?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: Double Click to Exclude Numbers</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/</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: david</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-29399</link>
		<dc:creator>david</dc:creator>
		<pubDate>Fri, 14 Dec 2007 11:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-29399</guid>
		<description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;i have a spreadsheet that extracts a trial balance from my data sheet and adds all the like expenses together to give me a total using sumif function.&lt;/p&gt;
&lt;p&gt;what i would like to do is doubleclick on a Trial Balance expense and get a list of same items on a seperate sheet like say if i doubleclick on PURCHASES it would give me a list of all the items entered i.e list all the purchases for the year.&lt;/p&gt;
&lt;p&gt;IS THERE A VBA FUNCTION OR MACRO THAT I CAN BUILD.&lt;/p&gt;
&lt;p&gt;MANY THANKS&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>hi,</p>
<p>i have a spreadsheet that extracts a trial balance from my data sheet and adds all the like expenses together to give me a total using sumif function.</p>
<p>what i would like to do is doubleclick on a Trial Balance expense and get a list of same items on a seperate sheet like say if i doubleclick on PURCHASES it would give me a list of all the items entered i.e list all the purchases for the year.</p>
<p>IS THERE A VBA FUNCTION OR MACRO THAT I CAN BUILD.</p>
<p>MANY THANKS</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26646</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Tue, 21 Aug 2007 08:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26646</guid>
		<description>&lt;p&gt;If there was as formula I would store it as a comment and the convert the cell contents to a value.&lt;br&gt;
If the user clicked again the Contents of the comment viz the formula would come back in to the cell.&lt;/p&gt;
&lt;p&gt;If the cell has no comment the Target.comment.Text would return &quot;Nothing&quot; and hence would not effect the contents...&lt;/p&gt;
&lt;p&gt;Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)&lt;/p&gt;
&lt;p&gt;If Target.HasFormula Then&lt;br&gt;
Target.AddComment (Target.Formula)&lt;br&gt;
End If&lt;/p&gt;
&lt;p&gt;If Application.WorksheetFunction.Count(Target) = 0 Then&lt;br&gt;
Selection.Value = Selection.Value * 1&lt;br&gt;
Target.Value = Target.Comment.Text&lt;br&gt;
Target.Comment.Delete&lt;br&gt;
Selection.Font.Strikethrough = False&lt;br&gt;
Else&lt;br&gt;
Selection.Value = &quot;&#039;&quot; &amp; Selection.Value&lt;br&gt;
Selection.Font.Strikethrough = True&lt;br&gt;
End If&lt;br&gt;
End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If there was as formula I would store it as a comment and the convert the cell contents to a value.<br />
If the user clicked again the Contents of the comment viz the formula would come back in to the cell.</p>
<p>If the cell has no comment the Target.comment.Text would return &#8220;Nothing&#8221; and hence would not effect the contents&#8230;</p>
<p>Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)</p>
<p>If Target.HasFormula Then<br />
Target.AddComment (Target.Formula)<br />
End If</p>
<p>If Application.WorksheetFunction.Count(Target) = 0 Then<br />
Selection.Value = Selection.Value * 1<br />
Target.Value = Target.Comment.Text<br />
Target.Comment.Delete<br />
Selection.Font.Strikethrough = False<br />
Else<br />
Selection.Value = &#8220;&#8216;&#8221; &amp; Selection.Value<br />
Selection.Font.Strikethrough = True<br />
End If<br />
End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mathsmagician</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26630</link>
		<dc:creator>mathsmagician</dc:creator>
		<pubDate>Mon, 20 Aug 2007 17:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26630</guid>
		<description>&lt;p&gt;1500.000&#160;0.000&#160;400&#160;0&#160;1900&#160;3.2900&#160;3.18&#160;6042.00&#160;&lt;/p&gt;
&lt;p&gt;800.000&#160;0.000&#160;0&#160;-300&#160;500&#160;0.9100&#160;0.93&#160;465.00&#160;&lt;/p&gt;
&lt;p&gt;1000.000&#160;0.000&#160;700&#160;0&#160;1700&#160;1.5000&#160;1.55&#160;2635.00&#160;&lt;/p&gt;
&lt;p&gt;1560.000&#160;0.000&#160;640&#160;0&#160;2200&#160;1.1200&#160;1.18&#160;2596.00&#160;&lt;/p&gt;
&lt;p&gt;0.000&#160;0.000&#160;800&#160;0&#160;800&#160;3.1900&#160;3.40&#160;2720.00&#160;&lt;/p&gt;
&lt;p&gt;Hello Dick &lt;/p&gt;
&lt;p&gt;It is me again with some trivial problem for you but a frustration for me.   &lt;/p&gt;
&lt;p&gt;What is wrong with the above thery are suppose to be numbers but they are not and I cannot convert them?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>1500.000&nbsp;0.000&nbsp;400&nbsp;0&nbsp;1900&nbsp;3.2900&nbsp;3.18&nbsp;6042.00&nbsp;</p>
<p>800.000&nbsp;0.000&nbsp;0&nbsp;-300&nbsp;500&nbsp;0.9100&nbsp;0.93&nbsp;465.00&nbsp;</p>
<p>1000.000&nbsp;0.000&nbsp;700&nbsp;0&nbsp;1700&nbsp;1.5000&nbsp;1.55&nbsp;2635.00&nbsp;</p>
<p>1560.000&nbsp;0.000&nbsp;640&nbsp;0&nbsp;2200&nbsp;1.1200&nbsp;1.18&nbsp;2596.00&nbsp;</p>
<p>0.000&nbsp;0.000&nbsp;800&nbsp;0&nbsp;800&nbsp;3.1900&nbsp;3.40&nbsp;2720.00&nbsp;</p>
<p>Hello Dick </p>
<p>It is me again with some trivial problem for you but a frustration for me.   </p>
<p>What is wrong with the above thery are suppose to be numbers but they are not and I cannot convert them?</p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26603</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sun, 19 Aug 2007 23:25:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26603</guid>
		<description>&lt;p&gt;I&#039;ve done this with checkboxes, too. If the value is False, you can adjust the format in the cell so it&#039;s obvious the value is excluded, via strikethrough, font color, or other conditional format. It&#039;s much easier, and does not rely upon VBA and worksheet events.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve done this with checkboxes, too. If the value is False, you can adjust the format in the cell so it&#8217;s obvious the value is excluded, via strikethrough, font color, or other conditional format. It&#8217;s much easier, and does not rely upon VBA and worksheet events.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26601</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Sun, 19 Aug 2007 22:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26601</guid>
		<description>&lt;p&gt;I&#039;ve also done this sort of thing before. I use a shadow range like Dermot and a BeforeDoubleClick event handler. My shadow range is unprotected, but it contains 0s or 1s and is hidden. The event handler checks whether the double click occurred in a cell in the same row as the range of selectable values, and if so it toggles the state of the corresponding cell in the shadow range. It uses conditional formatting in the original range based on the state of the corresponding cell in the shadow range. Summary statistics become conditional. In my experience, it&#039;s easier and safer to change a few summary formulas than cell contents for many individual values.&lt;/p&gt;
&lt;p&gt;An non-VBA alternative involves putting a Forms checkbox to the left of each cell in the range of selectable values, then set each checkbox&#039;s LinkedCell to the corresponding cell in the shadow range. Conditional formatting then becomes optional since the checkbox would provide a visual indication of which values would be included or not, and the summary formulas would still be conditional. A bit more work to set up, but much of it could be automated with macros in a different workbook, so not distributed with the report workbook.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;ve also done this sort of thing before. I use a shadow range like Dermot and a BeforeDoubleClick event handler. My shadow range is unprotected, but it contains 0s or 1s and is hidden. The event handler checks whether the double click occurred in a cell in the same row as the range of selectable values, and if so it toggles the state of the corresponding cell in the shadow range. It uses conditional formatting in the original range based on the state of the corresponding cell in the shadow range. Summary statistics become conditional. In my experience, it&#8217;s easier and safer to change a few summary formulas than cell contents for many individual values.</p>
<p>An non-VBA alternative involves putting a Forms checkbox to the left of each cell in the range of selectable values, then set each checkbox&#8217;s LinkedCell to the corresponding cell in the shadow range. Conditional formatting then becomes optional since the checkbox would provide a visual indication of which values would be included or not, and the summary formulas would still be conditional. A bit more work to set up, but much of it could be automated with macros in a different workbook, so not distributed with the report workbook.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26568</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Sat, 18 Aug 2007 19:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26568</guid>
		<description>&lt;p&gt;Interesting implementation, Dick.  I would have taken a different approach since I am always leery about trying to change a cell.  In this case the first twist you ran into was a formula.  But, what if that was an array formula?  Or, worse, an array formula that spanned multiple cells?&lt;/p&gt;
&lt;p&gt;An alternative that might be worth considering is to use a named formula that includes/excludes cells as required.  You can still use the Strikethrough to visually show cells excluded from the calculation but other than that make no changes to the cell.&lt;/p&gt;
&lt;p&gt;The code below goes into the workbook code module.  Also required are the functions from &lt;a href=&quot;http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/&quot; rel=&quot;nofollow&quot;&gt;Two new range functions: Union and Subtract&lt;/a&gt; It&#039;s tested with array formulas, regular formulas, and constants.&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Option&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Explicit&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; getName(WS &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Worksheet, whatName &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Name&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Resume&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; getName = WS.Names(whatName)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;GoTo&lt;/span&gt; 0&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; getName &lt;span class=&quot;kw1&quot;&gt;Is&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Nothing&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Static&lt;/span&gt; OneTimeWarning &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Boolean&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Not&lt;/span&gt; OneTimeWarning &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; MsgBox &lt;span class=&quot;st0&quot;&gt;&quot;Capability requires use of the named range InclCells&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; OneTimeWarning = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Workbook_SheetBeforeDoubleClick(&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; Sh &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Object&lt;/span&gt;, _&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; Target &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range, Cancel &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Boolean&lt;/span&gt;)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; aCell &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Each&lt;/span&gt; aCell &lt;span class=&quot;kw1&quot;&gt;In&lt;/span&gt; Target&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; aCell.Style = &lt;span class=&quot;st0&quot;&gt;&quot;DoubleClickTrap&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; WS &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Worksheet, aName &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Name&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; WS = Sh&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; aName = getName(WS, &lt;span class=&quot;st0&quot;&gt;&quot;InclCells&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Not&lt;/span&gt; aName &lt;span class=&quot;kw1&quot;&gt;Is&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Nothing&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; aCell.Font.Strikethrough &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; aName.RefersTo = _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;st0&quot;&gt;&quot;=&quot;&lt;/span&gt; &amp; Union(WS.Range(aName.RefersTo), aCell).Address&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; aName.RefersTo = _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;st0&quot;&gt;&quot;=&quot;&lt;/span&gt; &amp; Subtract(WS.Range(aName.RefersTo), aCell).Address&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; aCell.Font.Strikethrough = &lt;span class=&quot;kw1&quot;&gt;Not&lt;/span&gt; aCell.Font.Strikethrough&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; Cancel = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; aCell&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Interesting implementation, Dick.  I would have taken a different approach since I am always leery about trying to change a cell.  In this case the first twist you ran into was a formula.  But, what if that was an array formula?  Or, worse, an array formula that spanned multiple cells?</p>
<p>An alternative that might be worth considering is to use a named formula that includes/excludes cells as required.  You can still use the Strikethrough to visually show cells excluded from the calculation but other than that make no changes to the cell.</p>
<p>The code below goes into the workbook code module.  Also required are the functions from <a href="http://www.dailydoseofexcel.com/archives/2007/08/17/two-new-range-functions-union-and-subtract/" rel="nofollow">Two new range functions: Union and Subtract</a> It&#8217;s tested with array formulas, regular formulas, and constants.</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Option</span> <span class="kw1">Explicit</span></p>
<p><span class="kw1">Function</span> getName(WS <span class="kw1">As</span> Worksheet, whatName <span class="kw1">As</span> <span class="kw1">String</span>) <span class="kw1">As</span> Name<br />
&nbsp; &nbsp; <span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">Resume</span> <span class="kw1">Next</span><br />
&nbsp; &nbsp; <span class="kw1">Set</span> getName = WS.Names(whatName)<br />
&nbsp; &nbsp; <span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> 0<br />
&nbsp; &nbsp; <span class="kw1">If</span> getName <span class="kw1">Is</span> <span class="kw1">Nothing</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Static</span> OneTimeWarning <span class="kw1">As</span> <span class="kw1">Boolean</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> <span class="kw1">Not</span> OneTimeWarning <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MsgBox <span class="st0">&#8220;Capability requires use of the named range InclCells&#8221;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OneTimeWarning = <span class="kw1">True</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">Function</span><br />
<span class="kw1">Private</span> <span class="kw1">Sub</span> Workbook_SheetBeforeDoubleClick(<span class="kw1">ByVal</span> Sh <span class="kw1">As</span> <span class="kw1">Object</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ByVal</span> Target <span class="kw1">As</span> Range, Cancel <span class="kw1">As</span> <span class="kw1">Boolean</span>)<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> aCell <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">For</span> <span class="kw1">Each</span> aCell <span class="kw1">In</span> Target<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> aCell.Style = <span class="st0">&#8220;DoubleClickTrap&#8221;</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Dim</span> WS <span class="kw1">As</span> Worksheet, aName <span class="kw1">As</span> Name<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Set</span> WS = Sh<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Set</span> aName = getName(WS, <span class="st0">&#8220;InclCells&#8221;</span>)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> <span class="kw1">Not</span> aName <span class="kw1">Is</span> <span class="kw1">Nothing</span> <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">If</span> aCell.Font.Strikethrough <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aName.RefersTo = _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8220;=&#8221;</span> &amp; Union(WS.Range(aName.RefersTo), aCell).Address<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aName.RefersTo = _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&#8220;=&#8221;</span> &amp; Subtract(WS.Range(aName.RefersTo), aCell).Address<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; aCell.Font.Strikethrough = <span class="kw1">Not</span> aCell.Font.Strikethrough<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Cancel = <span class="kw1">True</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">Next</span> aCell<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: dermot</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26544</link>
		<dc:creator>dermot</dc:creator>
		<pubDate>Fri, 17 Aug 2007 23:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26544</guid>
		<description>&lt;p&gt;This is a good example of where I would try to avoid using VBA, because this code makes it hard for someone else to see what&#039;s going on (remembering that most people don&#039;t know any VBA at all).&lt;/p&gt;
&lt;p&gt;You can do it easily enough without VBA by setting up a second &quot;shadow&quot; table identical to the first, which has formulae which simply equal the values in the first table. The user deletes the unwanted cells in the shadow table, and the original table has conditional formatting which strikes through entries which don&#039;t match the values in the shadow table. The AVERAGE &amp; STDDEV calculations are based on the values in the shadow table. A text box explains what is happening. The original table is protected, the shadow table is not.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is a good example of where I would try to avoid using VBA, because this code makes it hard for someone else to see what&#8217;s going on (remembering that most people don&#8217;t know any VBA at all).</p>
<p>You can do it easily enough without VBA by setting up a second &#8220;shadow&#8221; table identical to the first, which has formulae which simply equal the values in the first table. The user deletes the unwanted cells in the shadow table, and the original table has conditional formatting which strikes through entries which don&#8217;t match the values in the shadow table. The AVERAGE &amp; STDDEV calculations are based on the values in the shadow table. A text box explains what is happening. The original table is protected, the shadow table is not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Olivier</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26539</link>
		<dc:creator>Olivier</dc:creator>
		<pubDate>Fri, 17 Aug 2007 19:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26539</guid>
		<description>&lt;p&gt;I&#039;d like to work on it a bit, can you please send me your code so that I don&#039;t start from scratch&lt;br&gt;
thanks Olivier&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;d like to work on it a bit, can you please send me your code so that I don&#8217;t start from scratch<br />
thanks Olivier</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ken Wilson</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26538</link>
		<dc:creator>Ken Wilson</dc:creator>
		<pubDate>Fri, 17 Aug 2007 18:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26538</guid>
		<description>&lt;p&gt;it should be noted that if you change the value of a cell that is toggled-off (strikethrough is active), attempting to double click the cell again to toggle will cause an &quot;Invalid procedure call or argument&quot; error message.  Also - at the end of the code, you should include &quot;Cancel = True&quot; to cancel the double click action after the code has executed.  Lastly - consider enclosing this code in an if statement along the lines of &lt;/p&gt;
&lt;p&gt;If .Value  &quot;&quot; Then&lt;/p&gt;
&lt;p&gt;so that the custom action on double click will only execute if a cell already contains a value (double clicking blank cells will not execute the code)&lt;/p&gt;
&lt;p&gt;Ken&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>it should be noted that if you change the value of a cell that is toggled-off (strikethrough is active), attempting to double click the cell again to toggle will cause an &#8220;Invalid procedure call or argument&#8221; error message.  Also &#8211; at the end of the code, you should include &#8220;Cancel = True&#8221; to cancel the double click action after the code has executed.  Lastly &#8211; consider enclosing this code in an if statement along the lines of </p>
<p>If .Value  &#8220;&#8221; Then</p>
<p>so that the custom action on double click will only execute if a cell already contains a value (double clicking blank cells will not execute the code)</p>
<p>Ken</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Alexander</title>
		<link>http://www.dailydoseofexcel.com/archives/2007/08/17/double-click-to-exclude-numbers/#comment-26536</link>
		<dc:creator>Mike Alexander</dc:creator>
		<pubDate>Fri, 17 Aug 2007 18:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1717#comment-26536</guid>
		<description>&lt;p&gt;Shoot, I didn&#039;t read carfully enough. I guess did do the same thing here.&lt;br&gt;
Duh.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Shoot, I didn&#8217;t read carfully enough. I guess did do the same thing here.<br />
Duh.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

