<?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: An Array of Column Letters</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/</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: keepITcool</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/#comment-5421</link>
		<dc:creator>keepITcool</dc:creator>
		<pubDate>Thu, 20 Jan 2005 14:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=984#comment-5421</guid>
		<description>&lt;p&gt;More ColumnLetter functions..&lt;br&gt;
shorter and 2x faster than Gary&#039;s overcomplex code. &gt;10x faster than Rob&#039;s elegant one-line solution&lt;/p&gt;
&lt;p&gt;Function ColumnLetter(ByVal colNum As Long) As String&lt;br&gt;
    colNum = (colNum - 1) Mod 256&lt;br&gt;
    If colNum &gt; 25 Then ColumnLetter = Chr$(64 + colNum  26)&lt;br&gt;
    ColumnLetter = ColumnLetter &amp; Chr$(65 + colNum Mod 26)&lt;br&gt;
End Function&lt;/p&gt;
&lt;p&gt;It does have a drawback if Excel ever gets beyond the 256 column boundary.. Following s/b future proof.&lt;/p&gt;
&lt;p&gt;Function ColumnLetter(ByVal colNum As Long) As String&lt;br&gt;
  Do&lt;br&gt;
    ColumnLetter = Chr$(65 + (colNum - 1) Mod 26) &amp; ColumnLetter&lt;br&gt;
    colNum = (colNum - 1)  26&lt;br&gt;
  Loop While colNum &gt; 0&lt;br&gt;
End Function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>More ColumnLetter functions..<br />
shorter and 2x faster than Gary&#8217;s overcomplex code. &gt;10x faster than Rob&#8217;s elegant one-line solution</p>
<p>Function ColumnLetter(ByVal colNum As Long) As String<br />
    colNum = (colNum &#8211; 1) Mod 256<br />
    If colNum &gt; 25 Then ColumnLetter = Chr$(64 + colNum  26)<br />
    ColumnLetter = ColumnLetter &amp; Chr$(65 + colNum Mod 26)<br />
End Function</p>
<p>It does have a drawback if Excel ever gets beyond the 256 column boundary.. Following s/b future proof.</p>
<p>Function ColumnLetter(ByVal colNum As Long) As String<br />
  Do<br />
    ColumnLetter = Chr$(65 + (colNum &#8211; 1) Mod 26) &amp; ColumnLetter<br />
    colNum = (colNum &#8211; 1)  26<br />
  Loop While colNum &gt; 0<br />
End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/#comment-5370</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Tue, 18 Jan 2005 13:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=984#comment-5370</guid>
		<description>&lt;p&gt;Like Dennis, I&#039;ve always cycled through the areas when I have a discontiguous range. I had to test this to be sure it worked.&lt;/p&gt;
&lt;p&gt;Rob&#039;s column number to letter code is pretty cool, too.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Like Dennis, I&#8217;ve always cycled through the areas when I have a discontiguous range. I had to test this to be sure it worked.</p>
<p>Rob&#8217;s column number to letter code is pretty cool, too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dennis</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/#comment-5368</link>
		<dc:creator>Dennis</dc:creator>
		<pubDate>Tue, 18 Jan 2005 11:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=984#comment-5368</guid>
		<description>&lt;p&gt;That&#039;s fantastic.  Thanks everyone.  My version had me monkeying around with Areasquite unnecessarily as it turns out!&lt;/p&gt;
&lt;p&gt;(Thanks also to RobI saw your ColumnLetter function on your website a while ago, and started using it because it&#039;s about 15 lines shorter than my own stab at this!)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>That&#8217;s fantastic.  Thanks everyone.  My version had me monkeying around with Areasquite unnecessarily as it turns out!</p>
<p>(Thanks also to RobI saw your ColumnLetter function on your website a while ago, and started using it because it&#8217;s about 15 lines shorter than my own stab at this!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/#comment-5367</link>
		<dc:creator>Dick</dc:creator>
		<pubDate>Mon, 17 Jan 2005 23:39:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=984#comment-5367</guid>
		<description>&lt;p&gt;Not a typo, just WordPress assuming it knows how to code HMTL.  The syntax hiliter is the best code rendering I&#039;ve seen, but it still sucks.  Any code with an ampersand or integer division is at risk.  I&#039;ll see if I can figure out how to escape it.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Not a typo, just WordPress assuming it knows how to code HMTL.  The syntax hiliter is the best code rendering I&#8217;ve seen, but it still sucks.  Any code with an ampersand or integer division is at risk.  I&#8217;ll see if I can figure out how to escape it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gary Waters</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/#comment-5365</link>
		<dc:creator>Gary Waters</dc:creator>
		<pubDate>Mon, 17 Jan 2005 22:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=984#comment-5365</guid>
		<description>&lt;p&gt;Dick,&lt;/p&gt;
&lt;p&gt;   Thanks for including my code. I did discover later on that you can eliminate the &#039;if colNum &gt; x Then&#039; statement because of the &#039;i&#039; variables initialization.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick,</p>
<p>   Thanks for including my code. I did discover later on that you can eliminate the &#8216;if colNum &gt; x Then&#8217; statement because of the &#8216;i&#8217; variables initialization.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake Marx</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/#comment-5364</link>
		<dc:creator>Jake Marx</dc:creator>
		<pubDate>Mon, 17 Jan 2005 22:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=984#comment-5364</guid>
		<description>&lt;p&gt;Dick,&lt;/p&gt;
&lt;p&gt;Just another way of doing it.  Seems to execute in about the same time.&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;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Const&lt;/span&gt; msRANGE &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt; = &lt;span class=&quot;st0&quot;&gt;&quot;C:D,F:I,L:Q&quot;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; Demo()&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; rngCol &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; Range&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; sTemp &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; asNewAddr() &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; lIdx &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Each&lt;/span&gt; rngCol &lt;span class=&quot;kw1&quot;&gt;In&lt;/span&gt; Range(msRANGE).Columns&lt;br&gt;
&#160; &#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;ReDim&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Preserve&lt;/span&gt; asNewAddr(lIdx)&lt;br&gt;
&#160; &#160; &#160; &#160; sTemp = rngCol.Address(&lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;, &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;)&lt;br&gt;
&#160; &#160; &#160; &#160; asNewAddr(lIdx) = Left$(sTemp, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160;InStr(1, sTemp, &lt;span class=&quot;st0&quot;&gt;&quot;:&quot;&lt;/span&gt;, _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160;vbBinaryCompare) - 1)&lt;br&gt;
&#160; &#160; &#160; &#160; lIdx = lIdx + 1&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt; rngCol&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;
</description>
		<content:encoded><![CDATA[<p>Dick,</p>
<p>Just another way of doing it.  Seems to execute in about the same time.</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Private</span> <span class="kw1">Const</span> msRANGE <span class="kw1">As</span> <span class="kw1">String</span> = <span class="st0">&#8220;C:D,F:I,L:Q&#8221;</span></p>
<p><span class="kw1">Sub</span> Demo()<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> rngCol <span class="kw1">As</span> Range<br />
&nbsp; &nbsp; <span class="kw1">Dim</span> sTemp <span class="kw1">As</span> <span class="kw1">String</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> asNewAddr() <span class="kw1">As</span> <span class="kw1">String</span><br />
&nbsp; &nbsp; <span class="kw1">Dim</span> lIdx <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="kw1">For</span> <span class="kw1">Each</span> rngCol <span class="kw1">In</span> Range(msRANGE).Columns<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">ReDim</span> <span class="kw1">Preserve</span> asNewAddr(lIdx)<br />
&nbsp; &nbsp; &nbsp; &nbsp; sTemp = rngCol.Address(<span class="kw1">False</span>, <span class="kw1">False</span>)<br />
&nbsp; &nbsp; &nbsp; &nbsp; asNewAddr(lIdx) = Left$(sTemp, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;InStr(1, sTemp, <span class="st0">&#8220;:&#8221;</span>, _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;vbBinaryCompare) &#8211; 1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lIdx = lIdx + 1<br />
&nbsp; &nbsp; <span class="kw1">Next</span> rngCol<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob van Gelder</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/01/17/an-array-of-column-letters/#comment-5362</link>
		<dc:creator>Rob van Gelder</dc:creator>
		<pubDate>Mon, 17 Jan 2005 21:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=984#comment-5362</guid>
		<description>&lt;p&gt;Hi Dick,&lt;/p&gt;
&lt;p&gt;Typo:&lt;br&gt;
In the function ColumnLetter with the line starting with Chr there is a missing backslash - just before the number 26 should go a backslash (integer divide)&lt;/p&gt;
&lt;p&gt;Out of interest, the ColumnLetter function I use is&lt;br&gt;
Split(Columns(colNum).Address(, False), &quot;:&quot;)(1)&lt;/p&gt;
&lt;p&gt;Cheers,&lt;br&gt;
Rob&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Dick,</p>
<p>Typo:<br />
In the function ColumnLetter with the line starting with Chr there is a missing backslash &#8211; just before the number 26 should go a backslash (integer divide)</p>
<p>Out of interest, the ColumnLetter function I use is<br />
Split(Columns(colNum).Address(, False), &#8220;:&#8221;)(1)</p>
<p>Cheers,<br />
Rob</p>
]]></content:encoded>
	</item>
</channel>
</rss>

