<?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: Create Unique List from Selected Cells</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/</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: Pete</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-48118</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Wed, 21 Jul 2010 06:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-48118</guid>
		<description>&lt;p&gt;Sorry about the code tags. Should be&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container text default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;text codecolorer&quot;&gt;Sub UniqueItems()&lt;br&gt;
&lt;br&gt;
&#160; On Error GoTo ErrorHandler&lt;br&gt;
&#160; With Selection&lt;br&gt;
&#160; &#160; .AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Cells(1, Cells.Find(what:=&quot;*&quot;, After:=Cells(1, 1), SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column + 2), Unique:=True&lt;br&gt;
&#160; End With&lt;br&gt;
&lt;br&gt;
ResumeHere:&lt;br&gt;
&#160; Exit Sub&lt;br&gt;
&lt;br&gt;
ErrorHandler:&lt;br&gt;
&#160; MsgBox Prompt:=&quot;Something went wrong !!&quot;, Buttons:=vbCritical, Title:=&quot;Error ...&quot;&lt;br&gt;
&#160; GoTo ResumeHere&lt;br&gt;
End Sub&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Sorry about the code tags. Should be</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container text default">
<div style="white-space: nowrap;" class="text codecolorer">Sub UniqueItems()</p>
<p>&nbsp; On Error GoTo ErrorHandler<br />
&nbsp; With Selection<br />
&nbsp; &nbsp; .AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Cells(1, Cells.Find(what:=&#8221;*&#8221;, After:=Cells(1, 1), SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column + 2), Unique:=True<br />
&nbsp; End With</p>
<p>ResumeHere:<br />
&nbsp; Exit Sub</p>
<p>ErrorHandler:<br />
&nbsp; MsgBox Prompt:=&#8221;Something went wrong !!&#8221;, Buttons:=vbCritical, Title:=&#8221;Error &#8230;&#8221;<br />
&nbsp; GoTo ResumeHere<br />
End Sub</div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pete</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-48117</link>
		<dc:creator>Pete</dc:creator>
		<pubDate>Wed, 21 Jul 2010 06:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-48117</guid>
		<description>&lt;p&gt;Code from my personal.xls file is below. Uses Excel&#039;s advanced filter, so there must be a header, and pastes result to the right hand side, one column clear. One plus I like with advanced filter is handling mutliple columns to return all distinct possibilities.&lt;/p&gt;
&lt;p&gt;[code]Sub UniqueItems()&lt;/p&gt;
&lt;p&gt;  On Error GoTo ErrorHandler&lt;br&gt;
  With Selection&lt;br&gt;
    .AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Cells(1, Cells.Find(what:=&quot;*&quot;, After:=Cells(1, 1), SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column + 2), Unique:=True&lt;br&gt;
  End With&lt;/p&gt;
&lt;p&gt;ResumeHere:&lt;br&gt;
  Exit Sub&lt;/p&gt;
&lt;p&gt;ErrorHandler:&lt;br&gt;
  MsgBox Prompt:=&quot;Something went wrong !!&quot;, Buttons:=vbCritical, Title:=&quot;Error ...&quot;&lt;br&gt;
  GoTo ResumeHere&lt;br&gt;
End Sub[/code]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Code from my personal.xls file is below. Uses Excel&#8217;s advanced filter, so there must be a header, and pastes result to the right hand side, one column clear. One plus I like with advanced filter is handling mutliple columns to return all distinct possibilities.</p>
<p>[code]Sub UniqueItems()</p>
<p>  On Error GoTo ErrorHandler<br />
  With Selection<br />
    .AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Cells(1, Cells.Find(what:="*", After:=Cells(1, 1), SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column + 2), Unique:=True<br />
  End With</p>
<p>ResumeHere:<br />
  Exit Sub</p>
<p>ErrorHandler:<br />
  MsgBox Prompt:="Something went wrong !!", Buttons:=vbCritical, Title:="Error ..."<br />
  GoTo ResumeHere<br />
End Sub[/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlos Rondão</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-43172</link>
		<dc:creator>Carlos Rondão</dc:creator>
		<pubDate>Tue, 05 Jan 2010 14:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-43172</guid>
		<description>&lt;p&gt;This is very easy without any programming:&lt;/p&gt;
&lt;p&gt;Values in A1:A30&lt;/p&gt;
&lt;p&gt;In B1 put value 1&lt;br&gt;
In B2 put the formula:&lt;br&gt;
=IF(ISERROR(MATCH(A2;$A$1:A1;0));MAX(B$1:B1)+1;&quot;&quot;)&lt;br&gt;
copy formula down till B30&lt;/p&gt;
&lt;p&gt;In C1 put the value 1&lt;br&gt;
In C2 the formula =C1+1&lt;/p&gt;
&lt;p&gt;In D1 the formula:&lt;br&gt;
=INDEX(A$1:A$30;MATCH(C1;$B$1:$B$30;0))&lt;/p&gt;
&lt;p&gt;copy to D2&lt;/p&gt;
&lt;p&gt;Now copy C2:D2 down...&lt;/p&gt;
&lt;p&gt;In column D you have the A1:A30 unique values&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>This is very easy without any programming:</p>
<p>Values in A1:A30</p>
<p>In B1 put value 1<br />
In B2 put the formula:<br />
=IF(ISERROR(MATCH(A2;$A$1:A1;0));MAX(B$1:B1)+1;&#8221;")<br />
copy formula down till B30</p>
<p>In C1 put the value 1<br />
In C2 the formula =C1+1</p>
<p>In D1 the formula:<br />
=INDEX(A$1:A$30;MATCH(C1;$B$1:$B$30;0))</p>
<p>copy to D2</p>
<p>Now copy C2:D2 down&#8230;</p>
<p>In column D you have the A1:A30 unique values</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Filtering Unique Cell Values in Excel « One Stop Analytics</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-39640</link>
		<dc:creator>Filtering Unique Cell Values in Excel « One Stop Analytics</dc:creator>
		<pubDate>Tue, 02 Jun 2009 13:02:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-39640</guid>
		<description>&lt;p&gt;[...] terms of speed goes. Refer to this page for a readymade piece of code, that runs like a darling! (http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/). Again, I&#039;m not very versatile with Collections, so I can&#039;t explain much. But [...]&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>[...] terms of speed goes. Refer to this page for a readymade piece of code, that runs like a darling! (<a href="http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/" rel="nofollow">http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/</a>). Again, I&#8217;m not very versatile with Collections, so I can&#8217;t explain much. But [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-36866</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Mon, 05 Jan 2009 22:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-36866</guid>
		<description>&lt;p&gt;If you go for speed:&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;Sub&lt;/span&gt; tst1()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; t &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, i &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, c0 &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;br&gt;
&#160; t = Timer&lt;br&gt;
&#160; Columns(1).SpecialCells(xlCellTypeConstants).AdvancedFilter xlFilterCopy, , [K1], &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;&lt;br&gt;
&#160; Debug.&lt;span class=&quot;kw1&quot;&gt;Print&lt;/span&gt; Timer - t&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;
&lt;p&gt;I tested this one to 3 alternatives with a list of 8000 textstrings.&lt;br&gt;
Speed performance tst1:tst2:tst3:tst4 = 1:23:55:112&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;Sub&lt;/span&gt; tst2()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; t &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, i &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, c0 &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;
&#160; t = Timer&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Set&lt;/span&gt; colUnique = &lt;span class=&quot;kw1&quot;&gt;New&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Collection&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Resume&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Each&lt;/span&gt; cl &lt;span class=&quot;kw1&quot;&gt;In&lt;/span&gt; Columns(1).SpecialCells(xlCellTypeConstants)&lt;br&gt;
&#160; &#160; colUnique.Add cl, Format(cl)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;On&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Error&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;GoTo&lt;/span&gt; 0&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; i = 0&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Each&lt;/span&gt; it &lt;span class=&quot;kw1&quot;&gt;In&lt;/span&gt; colUnique&lt;br&gt;
&#160; &#160; Range(&lt;span class=&quot;st0&quot;&gt;&quot;G1&quot;&lt;/span&gt;).Offset(i, 0).Value = it&lt;br&gt;
&#160; &#160; i = i + 1&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; Debug.&lt;span class=&quot;kw1&quot;&gt;Print&lt;/span&gt; Timer - t&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;
&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;Sub&lt;/span&gt; tst3()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; t &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, i &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, c0 &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; t = Timer&lt;br&gt;
&#160; sq = Application.WorksheetFunction.Transpose(Columns(1).SpecialCells(xlCellTypeConstants))&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; InStr(&lt;span class=&quot;st0&quot;&gt;&quot;#&quot;&lt;/span&gt; &amp; c0, &lt;span class=&quot;st0&quot;&gt;&quot;#&quot;&lt;/span&gt; &amp; sq(i) &amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;) = 0 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; c0 = c0 &amp; sq(i) &amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;#&quot;&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; sq = Split(c0, &lt;span class=&quot;st0&quot;&gt;&quot;&#124;#&quot;&lt;/span&gt;)&lt;br&gt;
&#160; Cells(1, 4).Resize(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq) + 1) = WorksheetFunction.Transpose(sq)&lt;br&gt;
&#160; Debug.&lt;span class=&quot;kw1&quot;&gt;Print&lt;/span&gt; Timer - t&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;
&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;Sub&lt;/span&gt; tst4()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; t &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, i &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, c0 &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;br&gt;
&#160; t = Timer&lt;br&gt;
&#160; sq = Split(&lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt; &amp; Join(Application.WorksheetFunction.Transpose(Columns(1).SpecialCells(xlCellTypeConstants)), &lt;span class=&quot;st0&quot;&gt;&quot;&#124;#&#124;&quot;&lt;/span&gt;) &amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;#&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; i = 0 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(Filter(sq, sq(i))) &gt; 0 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; sq(i) = &lt;span class=&quot;st0&quot;&gt;&quot;#&quot;&lt;/span&gt;&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; sq = Split(Replace(Join(Filter(sq, &lt;span class=&quot;st0&quot;&gt;&quot;#&quot;&lt;/span&gt;, &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;), &lt;span class=&quot;st0&quot;&gt;&quot;#&quot;&lt;/span&gt;), &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;), &lt;span class=&quot;st0&quot;&gt;&quot;#&quot;&lt;/span&gt;)&lt;br&gt;
&#160; Cells(1, 4).Resize(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq) + 1) = WorksheetFunction.Transpose(sq)&lt;br&gt;
&#160; Debug.&lt;span class=&quot;kw1&quot;&gt;Print&lt;/span&gt; Timer - t&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>If you go for speed:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> tst1()<br />
&nbsp; <span class="kw1">Dim</span> t <span class="kw1">As</span> <span class="kw1">Long</span>, i <span class="kw1">As</span> <span class="kw1">Long</span>, c0 <span class="kw1">As</span> <span class="kw1">String</span><br />
&nbsp; &nbsp; <br />
&nbsp; t = Timer<br />
&nbsp; Columns(1).SpecialCells(xlCellTypeConstants).AdvancedFilter xlFilterCopy, , [K1], <span class="kw1">True</span><br />
&nbsp; Debug.<span class="kw1">Print</span> Timer &#8211; t<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>I tested this one to 3 alternatives with a list of 8000 textstrings.<br />
Speed performance tst1:tst2:tst3:tst4 = 1:23:55:112</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> tst2()<br />
&nbsp; <span class="kw1">Dim</span> t <span class="kw1">As</span> <span class="kw1">Long</span>, i <span class="kw1">As</span> <span class="kw1">Long</span>, c0 <span class="kw1">As</span> <span class="kw1">String</span></p>
<p>&nbsp; t = Timer<br />
&nbsp; <span class="kw1">Set</span> colUnique = <span class="kw1">New</span> <span class="kw1">Collection</span><br />
&nbsp; <span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">Resume</span> <span class="kw1">Next</span><br />
&nbsp; <span class="kw1">For</span> <span class="kw1">Each</span> cl <span class="kw1">In</span> Columns(1).SpecialCells(xlCellTypeConstants)<br />
&nbsp; &nbsp; colUnique.Add cl, Format(cl)<br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; <span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> 0<br />
&nbsp; &nbsp; <br />
&nbsp; i = 0<br />
&nbsp; <span class="kw1">For</span> <span class="kw1">Each</span> it <span class="kw1">In</span> colUnique<br />
&nbsp; &nbsp; Range(<span class="st0">&#8220;G1&#8243;</span>).Offset(i, 0).Value = it<br />
&nbsp; &nbsp; i = i + 1<br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; Debug.<span class="kw1">Print</span> Timer &#8211; t<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> tst3()<br />
&nbsp; <span class="kw1">Dim</span> t <span class="kw1">As</span> <span class="kw1">Long</span>, i <span class="kw1">As</span> <span class="kw1">Long</span>, c0 <span class="kw1">As</span> <span class="kw1">String</span><br />
&nbsp; t = Timer<br />
&nbsp; sq = Application.WorksheetFunction.Transpose(Columns(1).SpecialCells(xlCellTypeConstants))<br />
&nbsp; <span class="kw1">For</span> i = 1 <span class="kw1">To</span> <span class="kw1">UBound</span>(sq)<br />
&nbsp; &nbsp; <span class="kw1">If</span> InStr(<span class="st0">&#8220;#&#8221;</span> &amp;amp; c0, <span class="st0">&#8220;#&#8221;</span> &amp;amp; sq(i) &amp;amp; <span class="st0">&#8220;|&#8221;</span>) = 0 <span class="kw1">Then</span> c0 = c0 &amp;amp; sq(i) &amp;amp; <span class="st0">&#8220;|#&#8221;</span><br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; sq = Split(c0, <span class="st0">&#8220;|#&#8221;</span>)<br />
&nbsp; Cells(1, 4).Resize(<span class="kw1">UBound</span>(sq) + 1) = WorksheetFunction.Transpose(sq)<br />
&nbsp; Debug.<span class="kw1">Print</span> Timer &#8211; t<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> tst4()<br />
&nbsp; <span class="kw1">Dim</span> t <span class="kw1">As</span> <span class="kw1">Long</span>, i <span class="kw1">As</span> <span class="kw1">Long</span>, c0 <span class="kw1">As</span> <span class="kw1">String</span><br />
&nbsp; &nbsp; <br />
&nbsp; t = Timer<br />
&nbsp; sq = Split(<span class="st0">&#8220;|&#8221;</span> &amp;amp; Join(Application.WorksheetFunction.Transpose(Columns(1).SpecialCells(xlCellTypeConstants)), <span class="st0">&#8220;|#|&#8221;</span>) &amp;amp; <span class="st0">&#8220;|&#8221;</span>, <span class="st0">&#8220;#&#8221;</span>)<br />
&nbsp; <span class="kw1">For</span> i = 0 <span class="kw1">To</span> <span class="kw1">UBound</span>(sq)<br />
&nbsp; &nbsp; <span class="kw1">If</span> <span class="kw1">UBound</span>(Filter(sq, sq(i))) &amp;gt; 0 <span class="kw1">Then</span> sq(i) = <span class="st0">&#8220;#&#8221;</span><br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; sq = Split(Replace(Join(Filter(sq, <span class="st0">&#8220;#&#8221;</span>, <span class="kw1">False</span>), <span class="st0">&#8220;#&#8221;</span>), <span class="st0">&#8220;|&#8221;</span>, <span class="st0">&#8220;&#8221;</span>), <span class="st0">&#8220;#&#8221;</span>)<br />
&nbsp; Cells(1, 4).Resize(<span class="kw1">UBound</span>(sq) + 1) = WorksheetFunction.Transpose(sq)<br />
&nbsp; Debug.<span class="kw1">Print</span> Timer &#8211; t<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie Hall</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-36861</link>
		<dc:creator>Charlie Hall</dc:creator>
		<pubDate>Mon, 05 Jan 2009 19:34:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-36861</guid>
		<description>&lt;p&gt;@Hans:&lt;/p&gt;
&lt;p&gt;Looks slick&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Hans:</p>
<p>Looks slick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Braithwaite</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-36842</link>
		<dc:creator>David Braithwaite</dc:creator>
		<pubDate>Mon, 05 Jan 2009 04:38:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-36842</guid>
		<description>&lt;p&gt;Hans&lt;br&gt;
nice solution for moderate amount of data getting appended to string.  But if large amount; each one causes the recopying of a bigger and bigger string and consume cobs of time as the string grows.  A more general solution might allocate a large string and then lay data into with a Mid(bigstring,x,y)= approach, appending more space only when the allocated space was used...&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hans<br />
nice solution for moderate amount of data getting appended to string.  But if large amount; each one causes the recopying of a bigger and bigger string and consume cobs of time as the string grows.  A more general solution might allocate a large string and then lay data into with a Mid(bigstring,x,y)= approach, appending more space only when the allocated space was used&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-36796</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Sat, 03 Jan 2009 00:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-36796</guid>
		<description>&lt;p&gt;@Charlie&lt;/p&gt;
&lt;p&gt;A simpler solution:&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;Sub&lt;/span&gt; enkel()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; sq &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; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; j &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; &lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; Selection.Columns.Count = 1 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; sq = Application.WorksheetFunction.Transpose(Selection.SpecialCells(xlCellTypeConstants))&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; j = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq)&lt;br&gt;
&#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; InStr(c0 amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt; amp; sq(j) amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;) = 0 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; c0 = c0 amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt; amp; sq(j)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; Sheets(1).[K1].Resize(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(Split(c0, &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;))) = Application.WorksheetFunction.Transpose(Split(Mid(c0, 2), &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;))&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&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;
&lt;p&gt;PS. A String can contain more then 2 million characters. So don&#039;t worry.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Charlie</p>
<p>A simpler solution:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Sub</span> enkel()<br />
&nbsp; <span class="kw1">Dim</span> sq <span class="kw1">As</span> <span class="kw1">Variant</span><br />
&nbsp; <span class="kw1">Dim</span> j <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; <br />
&nbsp; <span class="kw1">If</span> Selection.Columns.Count = 1 <span class="kw1">Then</span><br />
&nbsp; &nbsp; sq = Application.WorksheetFunction.Transpose(Selection.SpecialCells(xlCellTypeConstants))<br />
&nbsp; &nbsp; <span class="kw1">For</span> j = 1 <span class="kw1">To</span> <span class="kw1">UBound</span>(sq)<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">If</span> InStr(c0 amp; <span class="st0">&#8220;|&#8221;</span>, <span class="st0">&#8220;|&#8221;</span> amp; sq(j) amp; <span class="st0">&#8220;|&#8221;</span>) = 0 <span class="kw1">Then</span> c0 = c0 amp; <span class="st0">&#8220;|&#8221;</span> amp; sq(j)<br />
&nbsp; &nbsp; <span class="kw1">Next</span><br />
&nbsp; &nbsp; Sheets(1).[K1].Resize(<span class="kw1">UBound</span>(Split(c0, <span class="st0">&#8220;|&#8221;</span>))) = Application.WorksheetFunction.Transpose(Split(Mid(c0, 2), <span class="st0">&#8220;|&#8221;</span>))<br />
&nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>PS. A String can contain more then 2 million characters. So don&#8217;t worry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charlie Hall</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-36790</link>
		<dc:creator>Charlie Hall</dc:creator>
		<pubDate>Fri, 02 Jan 2009 19:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-36790</guid>
		<description>&lt;p&gt;@Hans&lt;br&gt;
I tried to implement your solution but was unable to get it to work.  I think there are three issues.  Your replacement string is &quot;&quot; so the two elements on either side get concatenated.  You start with a 1-based array and move to a 0-based array so the 2nd element gets skipped.  And the For termination value I believe is only evaluated at the beginning, but if there are many repeats, the array can shrink quickly, so near the end it will be evaluating non-existant array elements. &lt;/p&gt;
&lt;p&gt;I also wonder about how large a string can be - and as such, will this only work with small lists?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@Hans<br />
I tried to implement your solution but was unable to get it to work.  I think there are three issues.  Your replacement string is &#8220;&#8221; so the two elements on either side get concatenated.  You start with a 1-based array and move to a 0-based array so the 2nd element gets skipped.  And the For termination value I believe is only evaluated at the beginning, but if there are many repeats, the array can shrink quickly, so near the end it will be evaluating non-existant array elements. </p>
<p>I also wonder about how large a string can be &#8211; and as such, will this only work with small lists?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2008/12/11/create-unique-list-from-selected-cells/#comment-36517</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Wed, 17 Dec 2008 12:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1920#comment-36517</guid>
		<description>&lt;p&gt;@Jim&lt;/p&gt;
&lt;p&gt;You are quite right. To solve 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;Sub&lt;/span&gt; enkel()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; sq &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; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; j &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; &lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; Selection.Columns.Count = 1 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; sq = Application.WorksheetFunction.Transpose(Selection.SpecialCells(xlCellTypeConstants))&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;For&lt;/span&gt; j = 1 &lt;span class=&quot;kw1&quot;&gt;To&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq)&lt;br&gt;
&#160; &#160; &#160; sq=split(replace(&lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt; &amp; join(sq,&lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;) &amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt; &amp; sq(j) &amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;,&lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;) &amp; &lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt; &amp; sq(j),&lt;span class=&quot;st0&quot;&gt;&quot;&#124;&quot;&lt;/span&gt;)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; &#160; Sheets(1).[K1].Resize(&lt;span class=&quot;kw1&quot;&gt;UBound&lt;/span&gt;(sq) + 1) = Application.WorksheetFunction.Transpose(sq)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&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>@Jim</p>
<p>You are quite right. To solve 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">Sub</span> enkel()<br />
&nbsp; <span class="kw1">Dim</span> sq <span class="kw1">As</span> <span class="kw1">Variant</span><br />
&nbsp; <span class="kw1">Dim</span> j <span class="kw1">As</span> <span class="kw1">Long</span><br />
&nbsp; <br />
&nbsp; <span class="kw1">If</span> Selection.Columns.Count = 1 <span class="kw1">Then</span><br />
&nbsp; &nbsp; sq = Application.WorksheetFunction.Transpose(Selection.SpecialCells(xlCellTypeConstants))<br />
&nbsp; &nbsp; <span class="kw1">For</span> j = 1 <span class="kw1">To</span> <span class="kw1">UBound</span>(sq)<br />
&nbsp; &nbsp; &nbsp; sq=split(replace(<span class="st0">&#8220;|&#8221;</span> &amp;amp; join(sq,<span class="st0">&#8220;|&#8221;</span>) &amp;amp; <span class="st0">&#8220;|&#8221;</span>,<span class="st0">&#8220;|&#8221;</span> &amp;amp; sq(j) &amp;amp; <span class="st0">&#8220;|&#8221;</span>,<span class="st0">&#8220;&#8221;</span>) &amp;amp; <span class="st0">&#8220;|&#8221;</span> &amp;amp; sq(j),<span class="st0">&#8220;|&#8221;</span>)<br />
&nbsp; &nbsp; <span class="kw1">Next</span><br />
&nbsp; &nbsp; Sheets(1).[K1].Resize(<span class="kw1">UBound</span>(sq) + 1) = Application.WorksheetFunction.Transpose(sq)<br />
&nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
</channel>
</rss>

