<?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: Column Numbers To Letters</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:39:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Bob Lorenz</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-63690</link>
		<dc:creator>Bob Lorenz</dc:creator>
		<pubDate>Mon, 16 May 2011 22:16:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-63690</guid>
		<description>&lt;p&gt;How about this one?  I think it will work for any positive integer.&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; ColumnNumberToLetter(&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; intRowNum &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Integer&lt;/span&gt;) &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;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; strTemp &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;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Do&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;While&lt;/span&gt; intRowNum &gt; 0&lt;br&gt;
&#160; &#160; strTemp = Chr$((((intRowNum - 1) &lt;span class=&quot;kw1&quot;&gt;Mod&lt;/span&gt; 26) + 1) + 64) &amp; strTemp&lt;br&gt;
&#160; &#160; intRowNum = Int((intRowNum - 1) / 26)&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Loop&lt;/span&gt;&lt;br&gt;
ColumnNumberToLetter = strTemp&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>How about this one?  I think it will work for any positive integer.</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> ColumnNumberToLetter(<span class="kw1">ByVal</span> intRowNum <span class="kw1">As</span> <span class="kw1">Integer</span>) <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> strTemp <span class="kw1">As</span> <span class="kw1">String</span></p>
<p><span class="kw1">Do</span> <span class="kw1">While</span> intRowNum &gt; 0<br />
&nbsp; &nbsp; strTemp = Chr$((((intRowNum &#8211; 1) <span class="kw1">Mod</span> 26) + 1) + 64) &amp; strTemp<br />
&nbsp; &nbsp; intRowNum = Int((intRowNum &#8211; 1) / 26)<br />
<span class="kw1">Loop</span><br />
ColumnNumberToLetter = strTemp<br />
<span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-52451</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Mon, 11 Oct 2010 20:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-52451</guid>
		<description>&lt;p&gt;@Jorgen,&lt;/p&gt;
&lt;p&gt;This is from the original blog article... &quot;The challenge before you is to write a function that converts a column number to its letter equivalent assuming columns go to ZZZZ. That&#039;s about 450,000 columns - maybe more than I need.&quot; So, no, for that question, your code line would not work.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Jorgen,</p>
<p>This is from the original blog article&#8230; &#8220;The challenge before you is to write a function that converts a column number to its letter equivalent assuming columns go to ZZZZ. That&#8217;s about 450,000 columns &#8211; maybe more than I need.&#8221; So, no, for that question, your code line would not work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jorgen</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-52435</link>
		<dc:creator>Jorgen</dc:creator>
		<pubDate>Mon, 11 Oct 2010 16:12:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-52435</guid>
		<description>&lt;p&gt;Wouldn&#039;t this work?&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;&#160;MsgBox Split(Selection.Address(1, 0), &lt;span class=&quot;st0&quot;&gt;&quot;$&quot;&lt;/span&gt;)(0)&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;//Jorgen&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Wouldn&#8217;t this work?</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer">&nbsp;MsgBox Split(Selection.Address(1, 0), <span class="st0">&#8220;$&#8221;</span>)(0)</div>
</div>
<p>//Jorgen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-51177</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Fri, 24 Sep 2010 07:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-51177</guid>
		<description>&lt;p&gt;General Case Solution&lt;/p&gt;
&lt;p&gt;The following macro with accurately return the column number for a column letter input of up to 20 letters! So put the following into the indicated cells...&lt;/p&gt;
&lt;p&gt;A1:  ZZZZZZZZZZZZZZZZZZZZ&lt;/p&gt;
&lt;p&gt;A2   =ColLetToNum(A1)&lt;/p&gt;
&lt;p&gt;and cell A2 will display the column number of 20725274851017785518433805270. Of course, this value had to be returned to the cell as a text string. Anyway, here is the function...&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; ColLetToNum(&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; ColumnLetter &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;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Variant&lt;/span&gt;&lt;br&gt;
&#160; Power = 1&lt;br&gt;
&#160; NoChars = &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;(Len(ColumnLetter), &lt;span class=&quot;st0&quot;&gt;&quot;@&quot;&lt;/span&gt;)&lt;br&gt;
&#160; L = Split(StrConv(Right(NoChars &amp; UCase(ColumnLetter), Len(NoChars)), vbUnicode), Chr(0))&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; X = 0 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; Len(NoChars) - 1&lt;br&gt;
&#160; &#160; ColLetToNum = ColLetToNum + Power * (Asc(L(Len(NoChars) - 1 - X)) - 64)&lt;br&gt;
&#160; &#160; Power = Power * &lt;span class=&quot;kw1&quot;&gt;CDec&lt;/span&gt;(26)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; ColLetToNum = &lt;span class=&quot;kw1&quot;&gt;CStr&lt;/span&gt;(ColLetToNum)&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>General Case Solution</p>
<p>The following macro with accurately return the column number for a column letter input of up to 20 letters! So put the following into the indicated cells&#8230;</p>
<p>A1:  ZZZZZZZZZZZZZZZZZZZZ</p>
<p>A2   =ColLetToNum(A1)</p>
<p>and cell A2 will display the column number of 20725274851017785518433805270. Of course, this value had to be returned to the cell as a text string. Anyway, here is the function&#8230;</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> ColLetToNum(<span class="kw1">ByVal</span> ColumnLetter <span class="kw1">As</span> <span class="kw1">String</span>) <span class="kw1">As</span> <span class="kw1">Variant</span><br />
&nbsp; Power = 1<br />
&nbsp; NoChars = <span class="kw1">String</span>(Len(ColumnLetter), <span class="st0">&#8220;@&#8221;</span>)<br />
&nbsp; L = Split(StrConv(Right(NoChars &amp; UCase(ColumnLetter), Len(NoChars)), vbUnicode), Chr(0))<br />
&nbsp; <span class="kw1">For</span> X = 0 <span class="kw1">To</span> Len(NoChars) &#8211; 1<br />
&nbsp; &nbsp; ColLetToNum = ColLetToNum + Power * (Asc(L(Len(NoChars) &#8211; 1 &#8211; X)) &#8211; 64)<br />
&nbsp; &nbsp; Power = Power * <span class="kw1">CDec</span>(26)<br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; ColLetToNum = <span class="kw1">CStr</span>(ColLetToNum)<br />
<span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-51170</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Fri, 24 Sep 2010 06:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-51170</guid>
		<description>&lt;p&gt;Damn! Damn! Damn! A couple of bad constants. Here is the correct letters (A to ZZZZ) to column number function...&lt;/p&gt;
&lt;p&gt;Function ColLetToNum(ByVal ColumnLetter As String) As Double&lt;br&gt;
  L = Split(StrConv(Right(&quot;@@@@&quot; &amp; UCase(ColumnLetter), 4), vbUnicode), Chr(0))&lt;br&gt;
  ColLetToNum = 17576# * Asc(L(0)) + 676# * Asc(L(1)) + 26# * Asc(L(2)) + Asc(L(3)) - 1169856#&lt;br&gt;
End Function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Damn! Damn! Damn! A couple of bad constants. Here is the correct letters (A to ZZZZ) to column number function&#8230;</p>
<p>Function ColLetToNum(ByVal ColumnLetter As String) As Double<br />
  L = Split(StrConv(Right(&#8220;@@@@&#8221; &amp; UCase(ColumnLetter), 4), vbUnicode), Chr(0))<br />
  ColLetToNum = 17576# * Asc(L(0)) + 676# * Asc(L(1)) + 26# * Asc(L(2)) + Asc(L(3)) &#8211; 1169856#<br />
End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-51169</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Fri, 24 Sep 2010 06:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-51169</guid>
		<description>&lt;p&gt;Okay, for the original BLOG challenge to convert column letters from A up to ZZZZ to their numerical column number, this function should do that...&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; ColLetToNum(&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; ColumnLetter &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;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Double&lt;/span&gt;&lt;br&gt;
&#160; L = Split(StrConv(Right(&lt;span class=&quot;st0&quot;&gt;&quot;@@@@&quot;&lt;/span&gt; &amp; UCase(ColumnLetter), 4), vbUnicode), Chr(0))&lt;br&gt;
&#160; ColLetToNum = 17576# * Asc(L(0)) + 626# * Asc(L(1)) + 26# * Asc(L(2)) + Asc(L(3)) - 1166656#&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>Okay, for the original BLOG challenge to convert column letters from A up to ZZZZ to their numerical column number, this function should do that&#8230;</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> ColLetToNum(<span class="kw1">ByVal</span> ColumnLetter <span class="kw1">As</span> <span class="kw1">String</span>) <span class="kw1">As</span> <span class="kw1">Double</span><br />
&nbsp; L = Split(StrConv(Right(<span class="st0">&#8220;@@@@&#8221;</span> &amp; UCase(ColumnLetter), 4), vbUnicode), Chr(0))<br />
&nbsp; ColLetToNum = 17576# * Asc(L(0)) + 626# * Asc(L(1)) + 26# * Asc(L(2)) + Asc(L(3)) &#8211; 1166656#<br />
<span class="kw1">End</span> <span class="kw1">Function</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-51157</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Fri, 24 Sep 2010 04:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-51157</guid>
		<description>&lt;p&gt;Never mind... I just re-read the challenge and my code doesn&#039;t really address it. Sorry.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Never mind&#8230; I just re-read the challenge and my code doesn&#8217;t really address it. Sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-51155</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Fri, 24 Sep 2010 04:31:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-51155</guid>
		<description>&lt;p&gt;I guess even simpler would be this...&lt;/p&gt;
&lt;p&gt;Function ColLetToNum(ByVal ColumnLetter As String) As Double&lt;br&gt;
  ColLetToNum = Columns(ColumnLetter).Column&lt;br&gt;
End Function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I guess even simpler would be this&#8230;</p>
<p>Function ColLetToNum(ByVal ColumnLetter As String) As Double<br />
  ColLetToNum = Columns(ColumnLetter).Column<br />
End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rick Rothstein (MVP - Excel)</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-51154</link>
		<dc:creator>Rick Rothstein (MVP - Excel)</dc:creator>
		<pubDate>Fri, 24 Sep 2010 04:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-51154</guid>
		<description>&lt;p&gt;I know this is an old thread; but, unless I missed it, it doesn&#039;t look like anyone ever posted this extremely simple function...&lt;/p&gt;
&lt;p&gt;Function ColLetToNum(ByVal ColumnLetter As String) As Double&lt;br&gt;
  ColLetToNum = Range(ColumnLetter &amp; &quot;1?).Column&lt;br&gt;
End Function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I know this is an old thread; but, unless I missed it, it doesn&#8217;t look like anyone ever posted this extremely simple function&#8230;</p>
<p>Function ColLetToNum(ByVal ColumnLetter As String) As Double<br />
  ColLetToNum = Range(ColumnLetter &amp; &#8220;1?).Column<br />
End Function</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/21/column-numbers-to-letters/#comment-49549</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Mon, 30 Aug 2010 07:46:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=567#comment-49549</guid>
		<description>&lt;p&gt;@ incognito.  You would have to define a user defined variable type that will be bigger than double.  This will allow for enough accuracy to use this solution from above&lt;/p&gt;
&lt;p&gt;Function ColNumToLet(ByVal ColumnNumber As Double) As String&lt;br&gt;
If ColumnNumber 3.267215265265262E+15 Then&lt;br&gt;
ColNumToLet = &quot;Error&quot;&lt;br&gt;
Else&lt;br&gt;
ColNumToLet = &quot;&quot;&lt;br&gt;
If ColumnNumber 26&lt;br&gt;
If myMod(ColumnNumber, 26) = 0 Then&lt;br&gt;
ColNumToLet = &quot;Z&quot; &amp; ColNumToLet&lt;br&gt;
ColumnNumber = ColumnNumber - 1&lt;br&gt;
Else&lt;br&gt;
ColNumToLet = Chr(myMod(ColumnNumber, 26) + 64) &amp; ColNumToLet&lt;br&gt;
End If&lt;br&gt;
ColumnNumber = WorksheetFunction.RoundDown(ColumnNumber / 26, 0)&lt;br&gt;
Loop&lt;br&gt;
If Not ColumnNumber = 0 Then ColNumToLet = Chr(ColumnNumber + 64) &amp; ColNumToLet&lt;br&gt;
End If&lt;br&gt;
End If&lt;br&gt;
End Function&lt;/p&gt;
&lt;p&gt;Function myMod(Numerator As Double, Denominator As Double) As Double&lt;br&gt;
myMod = Numerator - (WorksheetFunction.RoundDown(Numerator / Denominator, 0) * Denominator)&lt;br&gt;
End Function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@ incognito.  You would have to define a user defined variable type that will be bigger than double.  This will allow for enough accuracy to use this solution from above</p>
<p>Function ColNumToLet(ByVal ColumnNumber As Double) As String<br />
If ColumnNumber 3.267215265265262E+15 Then<br />
ColNumToLet = &#8220;Error&#8221;<br />
Else<br />
ColNumToLet = &#8220;&#8221;<br />
If ColumnNumber 26<br />
If myMod(ColumnNumber, 26) = 0 Then<br />
ColNumToLet = &#8220;Z&#8221; &amp; ColNumToLet<br />
ColumnNumber = ColumnNumber &#8211; 1<br />
Else<br />
ColNumToLet = Chr(myMod(ColumnNumber, 26) + 64) &amp; ColNumToLet<br />
End If<br />
ColumnNumber = WorksheetFunction.RoundDown(ColumnNumber / 26, 0)<br />
Loop<br />
If Not ColumnNumber = 0 Then ColNumToLet = Chr(ColumnNumber + 64) &amp; ColNumToLet<br />
End If<br />
End If<br />
End Function</p>
<p>Function myMod(Numerator As Double, Denominator As Double) As Double<br />
myMod = Numerator &#8211; (WorksheetFunction.RoundDown(Numerator / Denominator, 0) * Denominator)<br />
End Function</p>
]]></content:encoded>
	</item>
</channel>
</rss>

