<?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: Deselect Listbox</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/05/11/deselect-listbox/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/05/11/deselect-listbox/</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: Hans Schraven</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/11/deselect-listbox/#comment-32970</link>
		<dc:creator>Hans Schraven</dc:creator>
		<pubDate>Wed, 18 Jun 2008 09:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=535#comment-32970</guid>
		<description>&lt;p&gt;I&#039;d rather prefer multi-usable buttons.&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;Sub&lt;/span&gt; cmdAll_Click()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; ListBox1&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; .ListCount - 1&lt;br&gt;
&#160; &#160; .Selected(i) = &lt;span class=&quot;kw1&quot;&gt;Not&lt;/span&gt; .Selected(i)&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;Next&lt;/span&gt;&lt;br&gt;
&#160; cmdAll.Caption=iif(.Selected(0),&lt;span class=&quot;st0&quot;&gt;&quot;Un&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;select All&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;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; cmdOdds_Click()&lt;br&gt;
&#160; &lt;span class=&quot;kw1&quot;&gt;With&lt;/span&gt; Me.ListBox1&lt;br&gt;
&#160; &#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; .ListCount - 1&lt;br&gt;
&#160; &#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; .List(i &lt;span class=&quot;kw1&quot;&gt;Mod&lt;/span&gt; 2) = 1 &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt; .Selected(i) = &lt;span class=&quot;kw1&quot;&gt;not&lt;/span&gt; .selected(i)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Next&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;With&lt;/span&gt;&lt;br&gt;
&#160; cmdOdds.Caption=iif(.Selected(1),&lt;span class=&quot;st0&quot;&gt;&quot;Un&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;select Odds&quot;&lt;/span&gt; &#160;&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;A suggestion to fill the listbox elegantly and fast:&lt;br&gt;
&lt;code lang=&quot;vb&quot;&gt;Private Sub Userform_Initialize()&lt;br&gt;
  Listbox1.List=split(&quot;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#124;8&#124;9&#124;10&#124;11&#124;12&quot;,&quot;&#124;&quot;)&lt;br&gt;
End Sub&lt;/code&gt;&lt;code lang=&quot;vb&quot;&gt;&lt;/code&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I&#8217;d rather prefer multi-usable buttons.</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">Sub</span> cmdAll_Click()<br />
&nbsp; <span class="kw1">With</span> ListBox1<br />
&nbsp; <span class="kw1">For</span> i = 0 <span class="kw1">To</span> .ListCount &#8211; 1<br />
&nbsp; &nbsp; .Selected(i) = <span class="kw1">Not</span> .Selected(i)<br />
&nbsp; <span class="kw1">Next</span><br />
&nbsp; cmdAll.Caption=iif(.Selected(0),<span class="st0">&#8220;Un&#8221;</span>,<span class="st0">&#8220;&#8221;</span>) &amp;amp; <span class="st0">&#8220;select All&#8221;</span><br />
<span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Private</span> <span class="kw1">Sub</span> cmdOdds_Click()<br />
&nbsp; <span class="kw1">With</span> Me.ListBox1<br />
&nbsp; &nbsp; <span class="kw1">For</span> i = 0 <span class="kw1">To</span> .ListCount &#8211; 1<br />
&nbsp; &nbsp; &nbsp; <span class="kw1">If</span> .List(i <span class="kw1">Mod</span> 2) = 1 <span class="kw1">Then</span> .Selected(i) = <span class="kw1">not</span> .selected(i)<br />
&nbsp; &nbsp; <span class="kw1">Next</span><br />
&nbsp; <span class="kw1">End</span> <span class="kw1">With</span><br />
&nbsp; cmdOdds.Caption=iif(.Selected(1),<span class="st0">&#8220;Un&#8221;</span>,<span class="st0">&#8220;&#8221;</span>) &amp;amp; <span class="st0">&#8220;select Odds&#8221;</span> &nbsp;<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
<p>A suggestion to fill the listbox elegantly and fast:</p>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #E56717; font-weight: bold;">Private</span> <span style="color: #E56717; font-weight: bold;">Sub</span> Userform_Initialize()&lt;br&gt;<br />
&nbsp; Listbox1.List=split(<span style="color: #800000;">&quot;1|2|3|4|5|6|7|8|9|10|11|12&quot;</span>,<span style="color: #800000;">&quot;|&quot;</span>)&lt;br&gt;<br />
<span style="color: #8D38C9; font-weight: bold;">End</span> <span style="color: #E56717; font-weight: bold;">Sub</span></div></div>
<div class="codecolorer-container vb default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="vb codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;</div></div></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sakshi</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/05/11/deselect-listbox/#comment-32956</link>
		<dc:creator>sakshi</dc:creator>
		<pubDate>Tue, 17 Jun 2008 14:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=535#comment-32956</guid>
		<description>&lt;p&gt;good one&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>good one</p>
]]></content:encoded>
	</item>
</channel>
</rss>

