<?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: The (st)Range Object</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/07/07/the-strange-object/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/07/07/the-strange-object/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:28:40 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: James Cane</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/07/07/the-strange-object/#comment-14293</link>
		<dc:creator>James Cane</dc:creator>
		<pubDate>Fri, 24 Jun 2005 10:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=673#comment-14293</guid>
		<description>&lt;p&gt;The default property of the Range object is actually the hidden &quot;_Default()&quot; property.  If you go to the object browser in VBA, right click and choose &quot;Show Hidden Members&quot;, you&#039;ll see it.&lt;/p&gt;
&lt;p&gt;The interesting thing with the _Default property is that it takes two optional arguments, RowIndex and ColumnIndex and returns another Range object, using the Item property.  However, if you don&#039;t pass in any parameters, it returns the value of the range instead.  &lt;/p&gt;
&lt;p&gt;Hence the seemingly confusing behaviour.  &lt;/p&gt;
&lt;p&gt;Now where it really does get confusing is when you consider the Columns(), Cells() and Rows() properties.&lt;/p&gt;
&lt;p&gt;Ever wondered why the Count property returns the number of columns of a range which was obtained from the Columns property?  After all, in a regular range, Count returns the number of cells.&lt;/p&gt;
&lt;p&gt;The answer is that each Range object contains an internal flag which specifies if it&#039;s a cells range, a columns range or a rows range.  The behaviour of Count, Item and For-Each are then modified appropriately.  Clever, really.&lt;/p&gt;
&lt;p&gt;Another interesting point, which follows on from this, is that Cells, Columns and Rows don&#039;t actually take arguments.  Instead, they just return fresh Range objects and any arguments are then passed on to the new range&#039;s _Default property.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The default property of the Range object is actually the hidden &#8220;_Default()&#8221; property.  If you go to the object browser in VBA, right click and choose &#8220;Show Hidden Members&#8221;, you&#8217;ll see it.</p>
<p>The interesting thing with the _Default property is that it takes two optional arguments, RowIndex and ColumnIndex and returns another Range object, using the Item property.  However, if you don&#8217;t pass in any parameters, it returns the value of the range instead.  </p>
<p>Hence the seemingly confusing behaviour.  </p>
<p>Now where it really does get confusing is when you consider the Columns(), Cells() and Rows() properties.</p>
<p>Ever wondered why the Count property returns the number of columns of a range which was obtained from the Columns property?  After all, in a regular range, Count returns the number of cells.</p>
<p>The answer is that each Range object contains an internal flag which specifies if it&#8217;s a cells range, a columns range or a rows range.  The behaviour of Count, Item and For-Each are then modified appropriately.  Clever, really.</p>
<p>Another interesting point, which follows on from this, is that Cells, Columns and Rows don&#8217;t actually take arguments.  Instead, they just return fresh Range objects and any arguments are then passed on to the new range&#8217;s _Default property.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Woodhouse</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/07/07/the-strange-object/#comment-1925</link>
		<dc:creator>Mike Woodhouse</dc:creator>
		<pubDate>Fri, 09 Jul 2004 18:06:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=673#comment-1925</guid>
		<description>&lt;p&gt;While some of the behaviour is certainly weird, there are useful aspects.&lt;/p&gt;
&lt;p&gt;For example, I often find myself specifying a one-cell Range to indicate the top-left cell of an arbitrarily large output table. If I want to fill the table as I go, I can use &lt;/p&gt;
&lt;p&gt;targetRange.Cells(row, column)&lt;/p&gt;
&lt;p&gt;, which I find is more intention-revealing than&lt;/p&gt;
&lt;p&gt;targetRange.Offset(offsetRows, offsetColumns)&lt;/p&gt;
&lt;p&gt;My £0.02p...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>While some of the behaviour is certainly weird, there are useful aspects.</p>
<p>For example, I often find myself specifying a one-cell Range to indicate the top-left cell of an arbitrarily large output table. If I want to fill the table as I go, I can use </p>
<p>targetRange.Cells(row, column)</p>
<p>, which I find is more intention-revealing than</p>
<p>targetRange.Offset(offsetRows, offsetColumns)</p>
<p>My £0.02p&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ross</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/07/07/the-strange-object/#comment-1924</link>
		<dc:creator>ross</dc:creator>
		<pubDate>Thu, 08 Jul 2004 22:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=673#comment-1924</guid>
		<description>&lt;p&gt;.... then item 4 will be a2, &lt;/p&gt;
&lt;p&gt;when range = &quot;a1? item 2 is a2, &lt;/p&gt;
&lt;p&gt;and when range (&quot;a1:b90?) item 3 is a2&lt;/p&gt;
&lt;p&gt;so the range effects the rows, limts the number of rows in a &quot;range&quot;, but not the number of colums....? hummm&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8230;. then item 4 will be a2, </p>
<p>when range = &#8220;a1? item 2 is a2, </p>
<p>and when range (&#8220;a1:b90?) item 3 is a2</p>
<p>so the range effects the rows, limts the number of rows in a &#8220;range&#8221;, but not the number of colums&#8230;.? hummm</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/07/07/the-strange-object/#comment-1923</link>
		<dc:creator>Dick</dc:creator>
		<pubDate>Thu, 08 Jul 2004 15:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=673#comment-1923</guid>
		<description>&lt;p&gt;and wiredest of all&lt;br&gt;
?range(&quot;a1:c1?).Item(70000).address&lt;br&gt;
$A$23334!!!&lt;/p&gt;
&lt;p&gt;That&#039;s because Item(2) is B1 and Item(3) is C1 - left to right before top to bottom.  70,000 / 3 = 23333 1/3.   Item(69,999) would be C23333, and one more goes to A of the next row.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>and wiredest of all<br />
?range(&#8220;a1:c1?).Item(70000).address<br />
$A$23334!!!</p>
<p>That&#8217;s because Item(2) is B1 and Item(3) is C1 &#8211; left to right before top to bottom.  70,000 / 3 = 23333 1/3.   Item(69,999) would be C23333, and one more goes to A of the next row.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/07/07/the-strange-object/#comment-1922</link>
		<dc:creator>Ross</dc:creator>
		<pubDate>Thu, 08 Jul 2004 10:20:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=673#comment-1922</guid>
		<description>&lt;p&gt;Just palying around with this &#039;cus its wried!&lt;/p&gt;
&lt;p&gt;?range(&quot;a1?).Item(70000).address&lt;br&gt;
&lt;i&gt;gives app error&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;?range(&quot;a1:b1?).Item(70000).address&lt;br&gt;
&lt;i&gt;gives $B$35000 ????&lt;/i&gt;&lt;/p&gt;
&lt;p&gt; and wiredest of all&lt;br&gt;
?range(&quot;a1:c1?).Item(70000).address&lt;br&gt;
&lt;b&gt;&lt;i&gt;$A$23334!!!&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;it contiues, for example...&lt;br&gt;
?range(&quot;a1:g1?).Item(120000).address&lt;br&gt;
&lt;i&gt;$F$17143&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;I was expecting something like&lt;br&gt;
(70000-65536 = 4464)&lt;br&gt;
?range(&quot;a1:b1?).Item(70000).address&lt;br&gt;
&lt;i&gt;gives $B$4464 ????&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;odd!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Just palying around with this &#8216;cus its wried!</p>
<p>?range(&#8220;a1?).Item(70000).address<br />
<i>gives app error</i></p>
<p>?range(&#8220;a1:b1?).Item(70000).address<br />
<i>gives $B$35000 ????</i></p>
<p> and wiredest of all<br />
?range(&#8220;a1:c1?).Item(70000).address<br />
<b><i>$A$23334!!!</i></b></p>
<p>it contiues, for example&#8230;<br />
?range(&#8220;a1:g1?).Item(120000).address<br />
<i>$F$17143</i></p>
<p>I was expecting something like<br />
(70000-65536 = 4464)<br />
?range(&#8220;a1:b1?).Item(70000).address<br />
<i>gives $B$4464 ????</i></p>
<p>odd!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

