<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Go Sub,  to go?</title>
	<link>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/</link>
	<description></description>
	<pubDate>Fri, 21 Nov 2008 22:03:08 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.1</generator>

	<item>
		<title>by: ross</title>
		<link>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-72</link>
		<pubDate>Mon, 27 Mar 2006 09:49:43 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-72</guid>
					<description>thanks John, Sorry that the code is not very well displayed, when time permits i will look into it ;-)</description>
		<content:encoded><![CDATA[<p>thanks John, Sorry that the code is not very well displayed, when time permits i will look into it ;-)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: John Skewes</title>
		<link>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-68</link>
		<pubDate>Fri, 24 Mar 2006 04:49:37 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-68</guid>
					<description>Hi Ross,

Yes, not to mention the static vars... Gosub and Return was used in a lot of earlier programming languages, notably BASIC (&lt;em&gt;the grandfather of VBA&lt;/em&gt;). 

You can have as many Gosub/Returns as you like in a procedure but its use has largely declined due to the propensity for novice programmers to use it in a loose unstructered manner, with GoSubs and Returns popping up everywhere in the main body of code. It then becomes difficult to follow the flow of the code. 

Never-the-less, it can be handy occasionally &lt;strong&gt;as long as it's kept structured and not 'overdone'&lt;/strong&gt;. I've updated the example on my site to show the difference, here it is (&lt;em&gt;I don't know if the code tags will show properly here&lt;/em&gt;)

---------------------------------------------------------------------------------

A simple example use of Gosub and Return...


[VBA]Sub CopyRows_UseGosub()

      Dim Cell As Range, TargetSheet As String

      With Sheets(&quot;Sheet1&quot;)
            For Each Cell In .Range(&quot;A2&quot;, .Range(&quot;A&quot; &amp;#38; Rows.Count).End(xlUp))
                  Select Case Cell.Offset(0, 4)
                  Case &quot;Match&quot;
                        TargetSheet = &quot;Sheet2&quot;: GoSub DoCopy
                  Case &quot;No Match&quot;
                        TargetSheet = &quot;Sheet3&quot;: GoSub DoCopy
                  Case &quot;Part Match&quot;
                        TargetSheet = &quot;Sheet4&quot;: GoSub DoCopy
                  Case &quot;Negative Match&quot;
                        TargetSheet = &quot;Sheet5&quot;: GoSub DoCopy
                  Case Else
                        TargetSheet = &quot;Sheet6&quot;: GoSub DoCopy
                  End Select
            Next
            Exit Sub

DoCopy:
            .Range(Cell.Address, Cell.Offset(0, 2)).Copy _
                        Sheets(TargetSheet).Range(&quot;A&quot; &amp;#38; Rows.Count) _
                        .End(xlUp).Offset(1, 0)
            Return

      End With
End Sub[/VBA]


As a comparison, the alternative code below to accomplish exactly the same task is 'wordier', more obscure for a coder to 'read', and it's difficult to ascertain the differences for each case (&lt;em&gt;the only differences being the sheets name&lt;/em&gt; :))


[VBA]Sub CopyRows_NoGosub()

      Dim Cell As Range

      With Sheets(&quot;Sheet1&quot;)
            For Each Cell In .Range(&quot;A2&quot;, .Range(&quot;A&quot; &amp;#38; Rows.Count).End(xlUp))
                  Select Case Cell.Offset(0, 4)
                  Case &quot;Match&quot;
                        .Range(Cell.Address, Cell.Offset(0, 2)).Copy _
                                    Sheets(&quot;Sheet2&quot;).Range(&quot;A&quot; &amp;#38; Rows.Count) _
                                    .End(xlUp).Offset(1, 0)
                  Case &quot;No Match&quot;
                        .Range(Cell.Address, Cell.Offset(0, 2)).Copy _
                                    Sheets(&quot;Sheet3&quot;).Range(&quot;A&quot; &amp;#38; Rows.Count) _
                                    .End(xlUp).Offset(1, 0)
                  Case &quot;Part Match&quot;
                        .Range(Cell.Address, Cell.Offset(0, 2)).Copy _
                                    Sheets(&quot;Sheet4&quot;).Range(&quot;A&quot; &amp;#38; Rows.Count) _
                                    .End(xlUp).Offset(1, 0)
                  Case &quot;Negative Match&quot;
                        .Range(Cell.Address, Cell.Offset(0, 2)).Copy _
                                    Sheets(&quot;Sheet5&quot;).Range(&quot;A&quot; &amp;#38; Rows.Count) _
                                    .End(xlUp).Offset(1, 0)
                  Case Else
                        .Range(Cell.Address, Cell.Offset(0, 2)).Copy _
                                    Sheets(&quot;Sheet6&quot;).Range(&quot;A&quot; &amp;#38; Rows.Count) _
                                    .End(xlUp).Offset(1, 0)
                  End Select
            Next
      End With
      
End Sub[/VBA]</description>
		<content:encoded><![CDATA[<p>Hi Ross,</p>
<p>Yes, not to mention the static vars... Gosub and Return was used in a lot of earlier programming languages, notably BASIC (<em>the grandfather of VBA</em>). </p>
<p>You can have as many Gosub/Returns as you like in a procedure but its use has largely declined due to the propensity for novice programmers to use it in a loose unstructered manner, with GoSubs and Returns popping up everywhere in the main body of code. It then becomes difficult to follow the flow of the code. </p>
<p>Never-the-less, it can be handy occasionally <strong>as long as it's kept structured and not 'overdone'</strong>. I've updated the example on my site to show the difference, here it is (<em>I don't know if the code tags will show properly here</em>)</p>
<p>---------------------------------------------------------------------------------</p>
<p>A simple example use of Gosub and Return...</p>
<div class="syntax_hilite">
<div id="vba-1">
<div class="vba"><span style="color: #0000DD;">Sub</span> CopyRows_UseGosub<span style="color:#202020; ">&#40;</span><span style="color:#202020; ">&#41;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Dim</span> Cell <span style="color: #0000DD;">As</span> Range, TargetSheet <span style="color: #0000DD;">As</span> <span style="color: #0000DD;">String</span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">With</span> Sheets<span style="color:#202020; ">&#40;</span><span style="color: #202020">"Sheet1"</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">For</span> <span style="color: #0000DD;">Each</span> Cell <span style="color: #0000DD;">In</span> .<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A2"</span>, .<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span>.<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Select</span> <span style="color: #0000DD;">Case</span> Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">4</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TargetSheet = <span style="color: #202020">"Sheet2"</span>: <span style="color: #0000DD;">GoSub</span> DoCopy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"No Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TargetSheet = <span style="color: #202020">"Sheet3"</span>: <span style="color: #0000DD;">GoSub</span> DoCopy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"Part Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TargetSheet = <span style="color: #202020">"Sheet4"</span>: <span style="color: #0000DD;">GoSub</span> DoCopy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"Negative Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TargetSheet = <span style="color: #202020">"Sheet5"</span>: <span style="color: #0000DD;">GoSub</span> DoCopy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #0000DD;">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TargetSheet = <span style="color: #202020">"Sheet6"</span>: <span style="color: #0000DD;">GoSub</span> DoCopy<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">End</span> <span style="color: #0000DD;">Select</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Next</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Exit</span> <span style="color: #0000DD;">Sub</span></p>
<p>DoCopy:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="">Range</span><span style="color:#202020; ">&#40;</span>Cell.<span style="">Address</span>, Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">2</span><span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span>.<span style="">Copy</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sheets<span style="color:#202020; ">&#40;</span>TargetSheet<span style="color:#202020; ">&#41;</span>.<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span>.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span>, <span style="color: #202020;">0</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Return</span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">End</span> <span style="color: #0000DD;">With</span><br />
<span style="color: #0000DD;">End</span> <span style="color: #0000DD;">Sub</span></div>
</div>
</div>
<p></p>
<p>As a comparison, the alternative code below to accomplish exactly the same task is 'wordier', more obscure for a coder to 'read', and it's difficult to ascertain the differences for each case (<em>the only differences being the sheets name</em> :))</p>
<div class="syntax_hilite">
<div id="vba-2">
<div class="vba"><span style="color: #0000DD;">Sub</span> CopyRows_NoGosub<span style="color:#202020; ">&#40;</span><span style="color:#202020; ">&#41;</span></p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Dim</span> Cell <span style="color: #0000DD;">As</span> Range</p>
<p>&nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">With</span> Sheets<span style="color:#202020; ">&#40;</span><span style="color: #202020">"Sheet1"</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">For</span> <span style="color: #0000DD;">Each</span> Cell <span style="color: #0000DD;">In</span> .<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A2"</span>, .<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span>.<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Select</span> <span style="color: #0000DD;">Case</span> Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">4</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="">Range</span><span style="color:#202020; ">&#40;</span>Cell.<span style="">Address</span>, Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">2</span><span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span>.<span style="">Copy</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sheets<span style="color:#202020; ">&#40;</span><span style="color: #202020">"Sheet2"</span><span style="color:#202020; ">&#41;</span>.<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span>.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span>, <span style="color: #202020;">0</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"No Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="">Range</span><span style="color:#202020; ">&#40;</span>Cell.<span style="">Address</span>, Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">2</span><span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span>.<span style="">Copy</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sheets<span style="color:#202020; ">&#40;</span><span style="color: #202020">"Sheet3"</span><span style="color:#202020; ">&#41;</span>.<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span>.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span>, <span style="color: #202020;">0</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"Part Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="">Range</span><span style="color:#202020; ">&#40;</span>Cell.<span style="">Address</span>, Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">2</span><span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span>.<span style="">Copy</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sheets<span style="color:#202020; ">&#40;</span><span style="color: #202020">"Sheet4"</span><span style="color:#202020; ">&#41;</span>.<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span>.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span>, <span style="color: #202020;">0</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #202020">"Negative Match"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="">Range</span><span style="color:#202020; ">&#40;</span>Cell.<span style="">Address</span>, Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">2</span><span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span>.<span style="">Copy</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sheets<span style="color:#202020; ">&#40;</span><span style="color: #202020">"Sheet5"</span><span style="color:#202020; ">&#41;</span>.<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span>.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span>, <span style="color: #202020;">0</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Case</span> <span style="color: #0000DD;">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="">Range</span><span style="color:#202020; ">&#40;</span>Cell.<span style="">Address</span>, Cell.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">0</span>, <span style="color: #202020;">2</span><span style="color:#202020; ">&#41;</span><span style="color:#202020; ">&#41;</span>.<span style="">Copy</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Sheets<span style="color:#202020; ">&#40;</span><span style="color: #202020">"Sheet6"</span><span style="color:#202020; ">&#41;</span>.<span style="">Range</span><span style="color:#202020; ">&#40;</span><span style="color: #202020">"A"</span> &amp;amp; Rows.<span style="">Count</span><span style="color:#202020; ">&#41;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #0000DD;">End</span><span style="color:#202020; ">&#40;</span>xlUp<span style="color:#202020; ">&#41;</span>.<span style="">Offset</span><span style="color:#202020; ">&#40;</span><span style="color: #202020;">1</span>, <span style="color: #202020;">0</span><span style="color:#202020; ">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">End</span> <span style="color: #0000DD;">Select</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">Next</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #0000DD;">End</span> <span style="color: #0000DD;">With</span><br />
&nbsp; &nbsp; &nbsp; <br />
<span style="color: #0000DD;">End</span> <span style="color: #0000DD;">Sub</span></div>
</div>
</div>
<p>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: ross</title>
		<link>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-65</link>
		<pubDate>Tue, 21 Mar 2006 11:29:17 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-65</guid>
					<description>Not to mention the static var dec too John - it's a stange one, but it guess it just another tool like toy say.</description>
		<content:encoded><![CDATA[<p>Not to mention the static var dec too John - it's a stange one, but it guess it just another tool like toy say.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: John Skewes</title>
		<link>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-62</link>
		<pubDate>Tue, 21 Mar 2006 03:07:16 +0000</pubDate>
		<guid>http://www.blog.methodsinexcel.co.uk/2006/02/15/go-sub-to-go/#comment-62</guid>
					<description>Hi Ross,

Yes, I usually would do the same, but it's useful when you may have (&lt;em&gt;say&lt;/em&gt;) lots of variables that you don't want to declare as public (&lt;em&gt;but then a function would probably be the way to go&lt;/em&gt;) anyway, it's another choice that's always available in our bag of tricks.

Regards,
John :)</description>
		<content:encoded><![CDATA[<p>Hi Ross,</p>
<p>Yes, I usually would do the same, but it's useful when you may have (<em>say</em>) lots of variables that you don't want to declare as public (<em>but then a function would probably be the way to go</em>) anyway, it's another choice that's always available in our bag of tricks.</p>
<p>Regards,<br />
John :)
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
