<?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: My Coding Technique</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Wed, 08 Feb 2012 23:58:05 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jerry Betz</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34795</link>
		<dc:creator>Jerry Betz</dc:creator>
		<pubDate>Mon, 15 Sep 2008 16:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34795</guid>
		<description>&lt;p&gt;Jon Peltier - Thank you very much.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jon Peltier &#8211; Thank you very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34792</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sun, 14 Sep 2008 23:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34792</guid>
		<description>&lt;p&gt;If wks.OLEObjects(&quot;CheckBox1?).Object.Value = True Then MsgBox &quot;True&quot;&lt;/p&gt;
&lt;p&gt;or simply&lt;/p&gt;
&lt;p&gt;If wks.OLEObjects(&quot;CheckBox1?).Object.Value Then MsgBox &quot;True&quot;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If wks.OLEObjects(&#8220;CheckBox1?).Object.Value = True Then MsgBox &#8220;True&#8221;</p>
<p>or simply</p>
<p>If wks.OLEObjects(&#8220;CheckBox1?).Object.Value Then MsgBox &#8220;True&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jerry Betz</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34782</link>
		<dc:creator>Jerry Betz</dc:creator>
		<pubDate>Sun, 14 Sep 2008 02:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34782</guid>
		<description>&lt;p&gt;Nick,&lt;/p&gt;
&lt;p&gt;Thank you for sharing your technique.  I admit to starting out as Phase I, and perhaps operating today in between your Phase II and the technique you outlined.  I have gone back to look at the last macro I worked on, and find that your technique indeed would have kept me out of a lot of trouble.  One question that I have is regarding check boxes from the control menu, in the past I would use:&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;If&lt;/span&gt; ActiveSheet.CheckBox1.Value = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; MsgBox &lt;span class=&quot;st0&quot;&gt;&quot;True&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;However, that errors out when I try to use your technique:&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;Sub&lt;/span&gt; wbwksvariables()&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; wb &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Workbook&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; wks &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Worksheet&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; wb = ActiveWorkbook&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; wks = wb.ActiveSheet&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; wks.CheckBox1.Value = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; MsgBox &lt;span class=&quot;st0&quot;&gt;&quot;True&quot;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&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;
&lt;p&gt;I find that intellisense will lead me to OLEObjects, and have tried:&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;&#160;&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; wks.OLEObjects(CheckBox1).Value = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; MsgBox &lt;span class=&quot;st0&quot;&gt;&quot;True&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;and&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;&#160;&lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; wks.OLEObjects(&lt;span class=&quot;st0&quot;&gt;&quot;CheckBox1&quot;&lt;/span&gt;).Value = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; MsgBox &lt;span class=&quot;st0&quot;&gt;&quot;True&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but haven&#039;t been able to get either of those to work.  Thanks for your help.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Nick,</p>
<p>Thank you for sharing your technique.  I admit to starting out as Phase I, and perhaps operating today in between your Phase II and the technique you outlined.  I have gone back to look at the last macro I worked on, and find that your technique indeed would have kept me out of a lot of trouble.  One question that I have is regarding check boxes from the control menu, in the past I would use:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">If</span> ActiveSheet.CheckBox1.Value = <span class="kw1">True</span> <span class="kw1">Then</span> MsgBox <span class="st0">&#8220;True&#8221;</span></div>
</div>
<p>However, that errors out when I try to use your technique:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> wbwksvariables()</p>
<p><span class="kw1">Dim</span> wb <span class="kw1">As</span> Workbook<br />
<span class="kw1">Dim</span> wks <span class="kw1">As</span> Worksheet</p>
<p><span class="kw1">Set</span> wb = ActiveWorkbook<br />
<span class="kw1">Set</span> wks = wb.ActiveSheet</p>
<p><span class="kw1">If</span> wks.CheckBox1.Value = <span class="kw1">True</span> <span class="kw1">Then</span> MsgBox <span class="st0">&#8220;True&#8221;</span></p>
<p><span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>I find that intellisense will lead me to OLEObjects, and have tried:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer">&nbsp;<span class="kw1">If</span> wks.OLEObjects(CheckBox1).Value = <span class="kw1">True</span> <span class="kw1">Then</span> MsgBox <span class="st0">&#8220;True&#8221;</span></div>
</div>
<p>and</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer">&nbsp;<span class="kw1">If</span> wks.OLEObjects(<span class="st0">&#8220;CheckBox1&#8243;</span>).Value = <span class="kw1">True</span> <span class="kw1">Then</span> MsgBox <span class="st0">&#8220;True&#8221;</span></div>
</div>
<p>but haven&#8217;t been able to get either of those to work.  Thanks for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephanie Smith</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34352</link>
		<dc:creator>Stephanie Smith</dc:creator>
		<pubDate>Thu, 21 Aug 2008 18:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34352</guid>
		<description>&lt;p&gt;@jmbob666: Basically &quot;subscript out of bounds&quot; means the code has tried to access an item in an array, and the item doesn&#039;t exist.  Make sure your worksheets collection actually has a sheet in it named &quot;Sheet1?.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@jmbob666: Basically &#8220;subscript out of bounds&#8221; means the code has tried to access an item in an array, and the item doesn&#8217;t exist.  Make sure your worksheets collection actually has a sheet in it named &#8220;Sheet1?.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jmbob666</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34329</link>
		<dc:creator>jmbob666</dc:creator>
		<pubDate>Wed, 20 Aug 2008 19:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34329</guid>
		<description>&lt;p&gt;This would be really useful to me if I could get it to work.  I&#039;m using Excel 2003 and I get a subscript out of bounds error (runtime error 9) when it hits: Set wks = wb.Worksheets(&quot;Sheet1?).  Anyone have an idea why?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This would be really useful to me if I could get it to work.  I&#8217;m using Excel 2003 and I get a subscript out of bounds error (runtime error 9) when it hits: Set wks = wb.Worksheets(&#8220;Sheet1?).  Anyone have an idea why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harald Staff</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34306</link>
		<dc:creator>Harald Staff</dc:creator>
		<pubDate>Tue, 19 Aug 2008 08:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34306</guid>
		<description>&lt;p&gt;Thanks Jan Karel. Now I&#039;m confused again BG...&lt;br&gt;
Seems that Listobject won&#039;t work for files made in older versions, while Connections does. In native 12 files, both methods seem to access the same object.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks Jan Karel. Now I&#8217;m confused again BG&#8230;<br />
Seems that Listobject won&#8217;t work for files made in older versions, while Connections does. In native 12 files, both methods seem to access the same object.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34297</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 19 Aug 2008 04:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34297</guid>
		<description>&lt;p&gt;Jan Karel - OCD = &quot;obsessive-compulsive disorder&quot;. If it&#039;s really bad, it&#039;s CDO, so the letters are in alphabetical order.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Jan Karel &#8211; OCD = &#8220;obsessive-compulsive disorder&#8221;. If it&#8217;s really bad, it&#8217;s CDO, so the letters are in alphabetical order.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fzz</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34289</link>
		<dc:creator>fzz</dc:creator>
		<pubDate>Mon, 18 Aug 2008 20:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34289</guid>
		<description>&lt;p&gt;Tushar Mehta - consider using a soundex or approximate matching function rather than exact matching to locate possibly slightly altered header strings if no exact match were found. Display the close but not exactly equal headers in a listbox in a dialog, and allow the user to select the &#039;correct&#039; one.&lt;/p&gt;
&lt;p&gt;The exact header strings and/or possibly matching regular expression patterns should be constants in the module code.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Tushar Mehta &#8211; consider using a soundex or approximate matching function rather than exact matching to locate possibly slightly altered header strings if no exact match were found. Display the close but not exactly equal headers in a listbox in a dialog, and allow the user to select the &#8216;correct&#8217; one.</p>
<p>The exact header strings and/or possibly matching regular expression patterns should be constants in the module code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34286</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Mon, 18 Aug 2008 19:21:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34286</guid>
		<description>&lt;p&gt;@Dan Maxey: Yes, it helps to use constants to identify columns in external data sources.  But, consider taking it a step further.  Recently, I completed a project where the client received data for 8 (expected to increase to 12 or 15) data sources from different corporate groups around the world.  Every month someone added / moved some data from some column to another.  Not to mention the location of the header row also shifted.  My solution was to create a function that located a column based on a header string.  Now, as long as the header strings remained intact, the code could adjust to headers being in an arbitrary row (obviously with preceding rows being blank) and data being in arbitrary columns.  Further, by building a map of the layout &quot;up front&quot; the code could gracefully fail if it found a header to be missing.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Dan Maxey: Yes, it helps to use constants to identify columns in external data sources.  But, consider taking it a step further.  Recently, I completed a project where the client received data for 8 (expected to increase to 12 or 15) data sources from different corporate groups around the world.  Every month someone added / moved some data from some column to another.  Not to mention the location of the header row also shifted.  My solution was to create a function that located a column based on a header string.  Now, as long as the header strings remained intact, the code could adjust to headers being in an arbitrary row (obviously with preceding rows being blank) and data being in arbitrary columns.  Further, by building a map of the layout &#8220;up front&#8221; the code could gracefully fail if it found a header to be missing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jkpieterse</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/08/15/my-coding-technique/#comment-34285</link>
		<dc:creator>jkpieterse</dc:creator>
		<pubDate>Mon, 18 Aug 2008 18:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1879#comment-34285</guid>
		<description>&lt;p&gt;Harold: Querytables are now children of the ListObject object.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Harold: Querytables are now children of the ListObject object.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

