<?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"
	>
<channel>
	<title>Comments on: Getting a range</title>
	<atom:link href="http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/feed/" rel="self" type="application/rss+xml" />
	<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/</link>
	<description>Simon Murphy on professional spreadsheet development stuff</description>
	<pubDate>Fri, 08 Aug 2008 19:52:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
		<item>
		<title>By: AlexJ</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-11772</link>
		<dc:creator>AlexJ</dc:creator>
		<pubDate>Sat, 26 Jul 2008 21:31:22 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-11772</guid>
		<description>Although this thread is now somewhat dormant, I just found it. I'll add my two cents:
1. I use [rangename] to refer to named ranges only, usually ones that hold constants or other goodies
2. Biggus Dickus: Everyone knows that us Canadian cowboys just say "Sorry"

Sorry.</description>
		<content:encoded><![CDATA[<p>Although this thread is now somewhat dormant, I just found it. I&#8217;ll add my two cents:<br />
1. I use [rangename] to refer to named ranges only, usually ones that hold constants or other goodies<br />
2. Biggus Dickus: Everyone knows that us Canadian cowboys just say &#8220;Sorry&#8221;</p>
<p>Sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dominik</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-11082</link>
		<dc:creator>Dominik</dc:creator>
		<pubDate>Tue, 08 Apr 2008 09:15:17 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-11082</guid>
		<description>Simon (and others),

if you use the Name Manager Add-in, there is a dropdown added to the VBE with all the names used in the worksheet. Adding the name in your code is just a click away...

Regards,
Dominik.</description>
		<content:encoded><![CDATA[<p>Simon (and others),</p>
<p>if you use the Name Manager Add-in, there is a dropdown added to the VBE with all the names used in the worksheet. Adding the name in your code is just a click away&#8230;</p>
<p>Regards,<br />
Dominik.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Williams</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-11008</link>
		<dc:creator>Charles Williams</dc:creator>
		<pubDate>Tue, 01 Apr 2008 08:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-11008</guid>
		<description>[... ] is a shortcut for Application.Evaluate(...) and so suffers from the Evaluate limitations.
Probably best to avoid it for that reason, altho most of the limitations dont apply to evaluating range names.</description>
		<content:encoded><![CDATA[<p>[... ] is a shortcut for Application.Evaluate(&#8230;) and so suffers from the Evaluate limitations.<br />
Probably best to avoid it for that reason, altho most of the limitations dont apply to evaluating range names.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biggus Dickus</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-10970</link>
		<dc:creator>Biggus Dickus</dc:creator>
		<pubDate>Fri, 28 Mar 2008 03:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-10970</guid>
		<description>"Range(”‘” &#38; Thisworkbook.Name &#38;”‘!RangeName”)

Isn’t that the same as

ThisWorkbook.Range(”RangeName”)?"

Yes - I use it because it's consistent with my other usage of range() .....  Habit I guess......

Dick</description>
		<content:encoded><![CDATA[<p>&#8220;Range(”‘” &amp; Thisworkbook.Name &amp;”‘!RangeName”)</p>
<p>Isn’t that the same as</p>
<p>ThisWorkbook.Range(”RangeName”)?&#8221;</p>
<p>Yes - I use it because it&#8217;s consistent with my other usage of range() &#8230;..  Habit I guess&#8230;&#8230;</p>
<p>Dick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jonpeltier</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-10969</link>
		<dc:creator>jonpeltier</dc:creator>
		<pubDate>Fri, 28 Mar 2008 03:07:38 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-10969</guid>
		<description>BD:

   Range(”‘” &#38; Thisworkbook.Name &#38;”‘!RangeName”)

Isn't that the same as

   ThisWorkbook.Range("RangeName")?

Of course, you should use RefersToRange.Value, not just .Value.

Simon: Those of us over 45 who had the misfortune to use the $-etc suffixes are hindered by not being able to remember.</description>
		<content:encoded><![CDATA[<p>BD:</p>
<p>   Range(”‘” &amp; Thisworkbook.Name &amp;”‘!RangeName”)</p>
<p>Isn&#8217;t that the same as</p>
<p>   ThisWorkbook.Range(&#8221;RangeName&#8221;)?</p>
<p>Of course, you should use RefersToRange.Value, not just .Value.</p>
<p>Simon: Those of us over 45 who had the misfortune to use the $-etc suffixes are hindered by not being able to remember.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biggus Dickus</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-10966</link>
		<dc:creator>Biggus Dickus</dc:creator>
		<pubDate>Thu, 27 Mar 2008 22:28:08 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-10966</guid>
		<description>"Yee-hah is the cowboy shout that comes to my mind."

Canadian cowboys say Yahooo (I guess).....</description>
		<content:encoded><![CDATA[<p>&#8220;Yee-hah is the cowboy shout that comes to my mind.&#8221;</p>
<p>Canadian cowboys say Yahooo (I guess)&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-10965</link>
		<dc:creator>Simon</dc:creator>
		<pubDate>Thu, 27 Mar 2008 21:47:44 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-10965</guid>
		<description>Yee-hah is the cowboy shout that comes to my mind.
Chris - I've never used range("A"&#38;..) - I thought I saw that in your code actually ;-)
I have certainly seen plenty of code like that.

I don't use all that dim s$, n# stuff, as like most people its too hard to remember, and its too cryptic for anyone under 35 who didn't have the misfortune to work with whatever version of VB made you do it that way. (me neither BTW)

Maybe I should do more like Johan and wrap them, but that seems like gold plating when I will use them exactly once (usually) to set up a range variable. I guess I could afford a few extra keystrokes, and a bit more RSI, to type range("...").

Rick I use .cells manly as its easier to decipher when debugging, if you use offset you then have to add the start point coordinates to your variables. No  idea on performance.</description>
		<content:encoded><![CDATA[<p>Yee-hah is the cowboy shout that comes to my mind.<br />
Chris - I&#8217;ve never used range(&#8221;A&#8221;&amp;..) - I thought I saw that in your code actually ;-)<br />
I have certainly seen plenty of code like that.</p>
<p>I don&#8217;t use all that dim s$, n# stuff, as like most people its too hard to remember, and its too cryptic for anyone under 35 who didn&#8217;t have the misfortune to work with whatever version of VB made you do it that way. (me neither BTW)</p>
<p>Maybe I should do more like Johan and wrap them, but that seems like gold plating when I will use them exactly once (usually) to set up a range variable. I guess I could afford a few extra keystrokes, and a bit more RSI, to type range(&#8221;&#8230;&#8221;).</p>
<p>Rick I use .cells manly as its easier to decipher when debugging, if you use offset you then have to add the start point coordinates to your variables. No  idea on performance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harlan Grove</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-10964</link>
		<dc:creator>Harlan Grove</dc:creator>
		<pubDate>Thu, 27 Mar 2008 19:44:29 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-10964</guid>
		<description>I've been told [A1] is slower than Range("A1") because (and Excel VBA help does state this) [A1] is treated as shorthand for Evaluate("A1"). I figure Evaluate involves more error checking than Range because all Range has to do is determine whether its argument is a valid range address or defined name evaluating to a range. Similar to the performance penalty from assigning objects to Variants rather than variables of the specific class.

There's also a syntactic difference. The token between the square brackets is effectively a string constant, so it's static. OTOH, Range can accept any string EXPRESSION that evaluates to a valid range reference.

As for myself, I'm pigheadedly explicit. I use defined names for interfaces to VBA code, and I set range class variables as

Set rng = workbookref.Names(nameref).RefersToRange

I try to avoid unqualified use of Range, and I never use [..] any more. Even using the shortcuts it provides, VBA isn't a terse language, so I go to the opposite extreme - logorrheic coding.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been told [A1] is slower than Range(&#8221;A1&#8243;) because (and Excel VBA help does state this) [A1] is treated as shorthand for Evaluate(&#8221;A1&#8243;). I figure Evaluate involves more error checking than Range because all Range has to do is determine whether its argument is a valid range address or defined name evaluating to a range. Similar to the performance penalty from assigning objects to Variants rather than variables of the specific class.</p>
<p>There&#8217;s also a syntactic difference. The token between the square brackets is effectively a string constant, so it&#8217;s static. OTOH, Range can accept any string EXPRESSION that evaluates to a valid range reference.</p>
<p>As for myself, I&#8217;m pigheadedly explicit. I use defined names for interfaces to VBA code, and I set range class variables as</p>
<p>Set rng = workbookref.Names(nameref).RefersToRange</p>
<p>I try to avoid unqualified use of Range, and I never use [..] any more. Even using the shortcuts it provides, VBA isn&#8217;t a terse language, so I go to the opposite extreme - logorrheic coding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Biggus Dickus</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-10960</link>
		<dc:creator>Biggus Dickus</dc:creator>
		<pubDate>Thu, 27 Mar 2008 17:48:29 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-10960</guid>
		<description>"The very fact that you suggested using Range(”A” &#38; n) has significantly boosted your cowboy rating in my eyes.."

Thanx (I think) ....  Yahooo !!! (that's what cowboys say)

I have found times where it is necessary to have sequentially numbered ranges (or I have inherited them) and I just cycle through them this way
Another thing I use is Range("'" &#38; Thisworkbook.Name &#38;"'!RangeName").value so I can refer back to the calling workook regardless of whether the file name has a space or spaces in it.  
Surely there are other ways to do this, but again it keeps my code consistent by using Range() which makes it easier for me to debug and to write (it's always faster to do things certain ways so I don't argue with myself on how to do things (?) )
...but I could be wrong ;-)... 

Dick</description>
		<content:encoded><![CDATA[<p>&#8220;The very fact that you suggested using Range(”A” &amp; n) has significantly boosted your cowboy rating in my eyes..&#8221;</p>
<p>Thanx (I think) &#8230;.  Yahooo !!! (that&#8217;s what cowboys say)</p>
<p>I have found times where it is necessary to have sequentially numbered ranges (or I have inherited them) and I just cycle through them this way<br />
Another thing I use is Range(&#8221;&#8216;&#8221; &amp; Thisworkbook.Name &amp;&#8221;&#8216;!RangeName&#8221;).value so I can refer back to the calling workook regardless of whether the file name has a space or spaces in it.<br />
Surely there are other ways to do this, but again it keeps my code consistent by using Range() which makes it easier for me to debug and to write (it&#8217;s always faster to do things certain ways so I don&#8217;t argue with myself on how to do things (?) )<br />
&#8230;but I could be wrong ;-)&#8230; </p>
<p>Dick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://smurfonspreadsheets.wordpress.com/2008/03/26/getting-a-range/#comment-10959</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Thu, 27 Mar 2008 17:14:02 +0000</pubDate>
		<guid isPermaLink="false">http://smurfonspreadsheets.wordpress.com/?p=551#comment-10959</guid>
		<description>I don't like the [] stuff either. However, I didn't realise that you could do Sheet1.[myname] - I thought you could only do [myname] and then you have this nasty business with active worksheets.

I've also always avoided Range("mynamedrange") and instead done Workbook.Names("mynamedrange").RefersToRange. Not exactly sure why that was either now.

The very fact that you suggested using Range("A" &#38; n) has significantly boosted your cowboy rating in my eyes..

Chris</description>
		<content:encoded><![CDATA[<p>I don&#8217;t like the [] stuff either. However, I didn&#8217;t realise that you could do Sheet1.[myname] - I thought you could only do [myname] and then you have this nasty business with active worksheets.</p>
<p>I&#8217;ve also always avoided Range(&#8221;mynamedrange&#8221;) and instead done Workbook.Names(&#8221;mynamedrange&#8221;).RefersToRange. Not exactly sure why that was either now.</p>
<p>The very fact that you suggested using Range(&#8221;A&#8221; &amp; n) has significantly boosted your cowboy rating in my eyes..</p>
<p>Chris</p>
]]></content:encoded>
	</item>
</channel>
</rss>
