<?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: Show All with a Range Parameter Query</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2005/10/28/show-all-with-a-range-parameter-query/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2005/10/28/show-all-with-a-range-parameter-query/</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: Doug Jenkins</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/10/28/show-all-with-a-range-parameter-query/#comment-28042</link>
		<dc:creator>Doug Jenkins</dc:creator>
		<pubDate>Sat, 13 Oct 2007 04:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1273#comment-28042</guid>
		<description>&lt;p&gt;Jeffrey - you use the = Range(&quot;rng&quot;) form where you are referring to a worksheet range with the name &quot;rng&quot;, but in the case of a function you have declared it as a range, so it is already a range object.&lt;/p&gt;
&lt;p&gt;Try this:&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;Function&lt;/span&gt; ReadCell(rng &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range, Rtype &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
Application.Volatile (&lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;)&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; Rtype&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; 1&lt;br&gt;
ReadCell = rng.Value&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; 2&lt;br&gt;
ReadCell = rng.Address&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; 3&lt;br&gt;
ReadCell = rng.Font.FontStyle&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; 4&lt;br&gt;
ReadCell = rng.Font.Name&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; 5&lt;br&gt;
ReadCell = rng.Height&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Case&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
ReadCell = &lt;span class=&quot;st0&quot;&gt;&quot;Rtype is defined for 1 to 5 only&quot;&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Select&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Jeffrey &#8211; you use the = Range(&#8220;rng&#8221;) form where you are referring to a worksheet range with the name &#8220;rng&#8221;, but in the case of a function you have declared it as a range, so it is already a range object.</p>
<p>Try this:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Function</span> ReadCell(rng <span class="kw1">As</span> Range, Rtype <span class="kw1">As</span> <span class="kw1">Long</span>) <span class="kw1">As</span> <span class="kw1">Variant</span><br />
Application.Volatile (<span class="kw1">True</span>)<br />
<span class="kw1">Select</span> <span class="kw1">Case</span> Rtype<br />
<span class="kw1">Case</span> 1<br />
ReadCell = rng.Value<br />
<span class="kw1">Case</span> 2<br />
ReadCell = rng.Address<br />
<span class="kw1">Case</span> 3<br />
ReadCell = rng.Font.FontStyle<br />
<span class="kw1">Case</span> 4<br />
ReadCell = rng.Font.Name<br />
<span class="kw1">Case</span> 5<br />
ReadCell = rng.Height<br />
<span class="kw1">Case</span> <span class="kw1">Else</span><br />
ReadCell = <span class="st0">&#8220;Rtype is defined for 1 to 5 only&#8221;</span><br />
<span class="kw1">End</span> <span class="kw1">Select</span><br />
<span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeffrey pattavina</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/10/28/show-all-with-a-range-parameter-query/#comment-28035</link>
		<dc:creator>Jeffrey pattavina</dc:creator>
		<pubDate>Fri, 12 Oct 2007 20:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1273#comment-28035</guid>
		<description>&lt;p&gt;I cannot get a VBA function to accept a range variable: The following function will not work. I want rng to be a cell range (i.e., A1)&lt;/p&gt;
&lt;p&gt;Function ReadCell(rng As Range)&lt;br&gt;
Application.Volatile (True)&lt;br&gt;
ReadCell = Range(&quot;rng&quot;)&lt;br&gt;
End Function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I cannot get a VBA function to accept a range variable: The following function will not work. I want rng to be a cell range (i.e., A1)</p>
<p>Function ReadCell(rng As Range)<br />
Application.Volatile (True)<br />
ReadCell = Range(&#8220;rng&#8221;)<br />
End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/10/28/show-all-with-a-range-parameter-query/#comment-17081</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Fri, 28 Oct 2005 22:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1273#comment-17081</guid>
		<description>&lt;p&gt;Much as what JK said...&lt;/p&gt;
&lt;p&gt;Use the &#039;like&#039; operator in your SQL statement.&lt;/p&gt;
&lt;p&gt;select CompanyName, City from customers where city like ?&lt;/p&gt;
&lt;p&gt;Range examples:&lt;br&gt;
London&lt;br&gt;
B%&lt;br&gt;
B_r%&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Much as what JK said&#8230;</p>
<p>Use the &#8216;like&#8217; operator in your SQL statement.</p>
<p>select CompanyName, City from customers where city like ?</p>
<p>Range examples:<br />
London<br />
B%<br />
B_r%</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jkpieterse</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/10/28/show-all-with-a-range-parameter-query/#comment-17079</link>
		<dc:creator>jkpieterse</dc:creator>
		<pubDate>Fri, 28 Oct 2005 17:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1273#comment-17079</guid>
		<description>&lt;p&gt;If you are using a like criterium (part of the SQL below):&lt;/p&gt;
&lt;p&gt;WHERE (ReferenceNumber Like &#039;%&#039; &amp; ? &amp; &#039;%&#039;)&lt;/p&gt;
&lt;p&gt;and you enter the percent sign in the linked cell, you also get all results back.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you are using a like criterium (part of the SQL below):</p>
<p>WHERE (ReferenceNumber Like &#8216;%&#8217; &amp; ? &amp; &#8216;%&#8217;)</p>
<p>and you enter the percent sign in the linked cell, you also get all results back.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

