<?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: Sheet Names in a DropDown on a Toolbar</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Tushar Mehta</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2812</link>
		<dc:creator>Tushar Mehta</dc:creator>
		<pubDate>Mon, 06 Dec 2004 19:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2812</guid>
		<description>&lt;p&gt;If someone wants to check out an integrated workbook/sheet navigator, check&lt;br&gt;
Workbook Window Navigator&lt;br&gt;
&lt;a href=&quot;http://www.tushar-mehta.com/excel/software/utilities/wb_nav.html&quot; rel=&quot;nofollow&quot;&gt;http://www.tushar-mehta.com/excel/software/utilities/wb_nav.html&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If someone wants to check out an integrated workbook/sheet navigator, check<br />
Workbook Window Navigator<br />
<a href="http://www.tushar-mehta.com/excel/software/utilities/wb_nav.html" rel="nofollow">http://www.tushar-mehta.com/excel/software/utilities/wb_nav.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Kabel</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2799</link>
		<dc:creator>Frank Kabel</dc:creator>
		<pubDate>Mon, 06 Dec 2004 16:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2799</guid>
		<description>&lt;p&gt;Hi&lt;br&gt;
problem are the apostrophes. They&#039;re not correctly represented in this code extract. Try the following code (hope I didn&#039;t miss one of the apostrophes):&lt;/p&gt;
&lt;p&gt;Public Const sCbName As String = &quot;SheetList&quot;&lt;/p&gt;
&lt;p&gt;Sub CreateCB()&lt;/p&gt;
&lt;p&gt;Dim cbSheets As CommandBarControl&lt;br&gt;
Dim oSheet As Object&lt;br&gt;
&#039; Delete commandbar if it exists&lt;br&gt;
On Error Resume Next&lt;br&gt;
Application.CommandBars(&quot;Cell&quot;).FindControl(, , sCbName).Delete&lt;br&gt;
On Error GoTo 0&lt;/p&gt;
&lt;p&gt;&#039; Create commandbar&lt;br&gt;
Set cbSheets = Application.CommandBars(&quot;Cell&quot;).Controls.Add(msoControlDropdown)&lt;/p&gt;
&lt;p&gt;With cbSheets&lt;br&gt;
.OnAction = &quot;ActivateSheet&quot;&lt;br&gt;
.BeginGroup = True&lt;br&gt;
.Tag = sCbName&lt;br&gt;
End With&lt;/p&gt;
&lt;p&gt;PopNames (sCbName)&lt;/p&gt;
&lt;p&gt;Application.CommandBars(&quot;Standard&quot;).FindControl(, 2520).OnAction = &quot;NewBook&quot;&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Sub ActivateSheet()&lt;/p&gt;
&lt;p&gt;Dim objVB As VBComponent&lt;/p&gt;
&lt;p&gt;With Application.CommandBars(&quot;Cell&quot;).FindControl(, , sCbName)&lt;br&gt;
strText = .Text&lt;br&gt;
PopNames (sCbName)&lt;br&gt;
Workbooks(strText).Activate&lt;br&gt;
End With&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Sub PopNames(strCBName As String)&lt;/p&gt;
&lt;p&gt;&#039; Populate with sheet names&lt;br&gt;
Application.CommandBars(&quot;Cell&quot;).FindControl(, , strCBName).Clear&lt;br&gt;
For Each oSheet In Workbooks&lt;br&gt;
Application.CommandBars(&quot;Cell&quot;).FindControl(, , strCBName).AddItem oSheet.Name&lt;br&gt;
Next oSheet&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Sub NewBook()&lt;/p&gt;
&lt;p&gt;Workbooks.Add&lt;br&gt;
PopNames (&quot;SheetList&quot;)&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi<br />
problem are the apostrophes. They&#8217;re not correctly represented in this code extract. Try the following code (hope I didn&#8217;t miss one of the apostrophes):</p>
<p>Public Const sCbName As String = &#8220;SheetList&#8221;</p>
<p>Sub CreateCB()</p>
<p>Dim cbSheets As CommandBarControl<br />
Dim oSheet As Object<br />
&#8216; Delete commandbar if it exists<br />
On Error Resume Next<br />
Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , sCbName).Delete<br />
On Error GoTo 0</p>
<p>&#8216; Create commandbar<br />
Set cbSheets = Application.CommandBars(&#8220;Cell&#8221;).Controls.Add(msoControlDropdown)</p>
<p>With cbSheets<br />
.OnAction = &#8220;ActivateSheet&#8221;<br />
.BeginGroup = True<br />
.Tag = sCbName<br />
End With</p>
<p>PopNames (sCbName)</p>
<p>Application.CommandBars(&#8220;Standard&#8221;).FindControl(, 2520).OnAction = &#8220;NewBook&#8221;</p>
<p>End Sub</p>
<p>Sub ActivateSheet()</p>
<p>Dim objVB As VBComponent</p>
<p>With Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , sCbName)<br />
strText = .Text<br />
PopNames (sCbName)<br />
Workbooks(strText).Activate<br />
End With</p>
<p>End Sub</p>
<p>Sub PopNames(strCBName As String)</p>
<p>&#8216; Populate with sheet names<br />
Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , strCBName).Clear<br />
For Each oSheet In Workbooks<br />
Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , strCBName).AddItem oSheet.Name<br />
Next oSheet</p>
<p>End Sub</p>
<p>Sub NewBook()</p>
<p>Workbooks.Add<br />
PopNames (&#8220;SheetList&#8221;)</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Faizal</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2798</link>
		<dc:creator>Faizal</dc:creator>
		<pubDate>Mon, 06 Dec 2004 15:35:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2798</guid>
		<description>&lt;p&gt;Hi, I&#039;m just a begginer plz help - lol I need to know what is standard module b&#039;coz i tried to create a new module and put the code in there.and run the code it gives me an error like this &quot; compile error&quot; constant Required. &lt;/p&gt;
&lt;p&gt;It would be highly apprecited if someone can give me solution to run this module. &lt;/p&gt;
&lt;p&gt;By the way the Toolbar looks excellent but i want to use it on my sheet &lt;/p&gt;
&lt;p&gt;Thankx&lt;/p&gt;
&lt;p&gt;Faizal&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi, I&#8217;m just a begginer plz help &#8211; lol I need to know what is standard module b&#8217;coz i tried to create a new module and put the code in there.and run the code it gives me an error like this &#8221; compile error&#8221; constant Required. </p>
<p>It would be highly apprecited if someone can give me solution to run this module. </p>
<p>By the way the Toolbar looks excellent but i want to use it on my sheet </p>
<p>Thankx</p>
<p>Faizal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Bigelow</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2215</link>
		<dc:creator>Mark Bigelow</dc:creator>
		<pubDate>Wed, 06 Oct 2004 20:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2215</guid>
		<description>&lt;p&gt;I took Dick&#039;s code and made it list the different workbooks in a drop-down when you right-click in Excel.  Automatically updates for new workbooks by changing the OnAction of the new workbook icon in Excel.&lt;/p&gt;
&lt;p&gt;Public Const sCbName As String = &quot;SheetList&quot;&lt;/p&gt;
&lt;p&gt;Sub CreateCB()&lt;/p&gt;
&lt;p&gt;    Dim cbSheets As CommandBarControl&lt;br&gt;
    Dim oSheet As Object&lt;/p&gt;
&lt;p&gt;    &#039;   Delete commandbar if it exists&lt;br&gt;
    On Error Resume Next&lt;br&gt;
        Application.CommandBars(&quot;Cell&quot;).FindControl(, , sCbName).Delete&lt;br&gt;
    On Error GoTo 0&lt;/p&gt;
&lt;p&gt;    &#039;   Create commandbar&lt;br&gt;
    Set cbSheets = Application.CommandBars(&quot;Cell&quot;).Controls.Add(msoControlDropdown)&lt;/p&gt;
&lt;p&gt;    With cbSheets&lt;br&gt;
        .OnAction = &quot;ActivateSheet&quot;&lt;br&gt;
        .BeginGroup = True&lt;br&gt;
        .Tag = sCbName&lt;br&gt;
    End With&lt;/p&gt;
&lt;p&gt;    PopNames (sCbName)&lt;/p&gt;
&lt;p&gt;    Application.CommandBars(&quot;Standard&quot;).FindControl(, 2520).OnAction = &quot;NewBook&quot;&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Sub ActivateSheet()&lt;/p&gt;
&lt;p&gt;    Dim objVB As VBComponent&lt;/p&gt;
&lt;p&gt;    With Application.CommandBars(&quot;Cell&quot;).FindControl(, , sCbName)&lt;br&gt;
        strText = .Text&lt;br&gt;
        PopNames (sCbName)&lt;br&gt;
        Workbooks(strText).Activate&lt;br&gt;
    End With&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Sub PopNames(strCBName As String)&lt;/p&gt;
&lt;p&gt;    &#039;   Populate with sheet names&lt;br&gt;
    Application.CommandBars(&quot;Cell&quot;).FindControl(, , strCBName).Clear&lt;br&gt;
    For Each oSheet In Workbooks&lt;br&gt;
        Application.CommandBars(&quot;Cell&quot;).FindControl(, , strCBName).AddItem oSheet.Name&lt;br&gt;
    Next oSheet&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Sub NewBook()&lt;/p&gt;
&lt;p&gt;    Workbooks.Add&lt;br&gt;
    PopNames (&quot;SheetList&quot;)&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I took Dick&#8217;s code and made it list the different workbooks in a drop-down when you right-click in Excel.  Automatically updates for new workbooks by changing the OnAction of the new workbook icon in Excel.</p>
<p>Public Const sCbName As String = &#8220;SheetList&#8221;</p>
<p>Sub CreateCB()</p>
<p>    Dim cbSheets As CommandBarControl<br />
    Dim oSheet As Object</p>
<p>    &#8216;   Delete commandbar if it exists<br />
    On Error Resume Next<br />
        Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , sCbName).Delete<br />
    On Error GoTo 0</p>
<p>    &#8216;   Create commandbar<br />
    Set cbSheets = Application.CommandBars(&#8220;Cell&#8221;).Controls.Add(msoControlDropdown)</p>
<p>    With cbSheets<br />
        .OnAction = &#8220;ActivateSheet&#8221;<br />
        .BeginGroup = True<br />
        .Tag = sCbName<br />
    End With</p>
<p>    PopNames (sCbName)</p>
<p>    Application.CommandBars(&#8220;Standard&#8221;).FindControl(, 2520).OnAction = &#8220;NewBook&#8221;</p>
<p>End Sub</p>
<p>Sub ActivateSheet()</p>
<p>    Dim objVB As VBComponent</p>
<p>    With Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , sCbName)<br />
        strText = .Text<br />
        PopNames (sCbName)<br />
        Workbooks(strText).Activate<br />
    End With</p>
<p>End Sub</p>
<p>Sub PopNames(strCBName As String)</p>
<p>    &#8216;   Populate with sheet names<br />
    Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , strCBName).Clear<br />
    For Each oSheet In Workbooks<br />
        Application.CommandBars(&#8220;Cell&#8221;).FindControl(, , strCBName).AddItem oSheet.Name<br />
    Next oSheet</p>
<p>End Sub</p>
<p>Sub NewBook()</p>
<p>    Workbooks.Add<br />
    PopNames (&#8220;SheetList&#8221;)</p>
<p>End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2214</link>
		<dc:creator>Dick</dc:creator>
		<pubDate>Fri, 03 Sep 2004 22:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2214</guid>
		<description>&lt;p&gt;Dale:  All this would go in a standard module.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dale:  All this would go in a standard module.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dale Dunphy</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2213</link>
		<dc:creator>Dale Dunphy</dc:creator>
		<pubDate>Fri, 03 Sep 2004 05:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2213</guid>
		<description>&lt;p&gt;As a relative newcomer to Excel programming, I am struggling with where to paste the code for this example.&lt;/p&gt;
&lt;p&gt;I pasted it all into This Workbook and got an error saying that Constants, fixed length arrays ..... are not allowed as public members of object modules.&lt;/p&gt;
&lt;p&gt;The offending line was the Public Const...line.  Where should this line have been placed.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>As a relative newcomer to Excel programming, I am struggling with where to paste the code for this example.</p>
<p>I pasted it all into This Workbook and got an error saying that Constants, fixed length arrays &#8230;.. are not allowed as public members of object modules.</p>
<p>The offending line was the Public Const&#8230;line.  Where should this line have been placed.</p>
<p>Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Harald Staff</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2212</link>
		<dc:creator>Harald Staff</dc:creator>
		<pubDate>Thu, 26 Aug 2004 00:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2212</guid>
		<description>&lt;p&gt;Why re-invent the wheel?&lt;br&gt;
One will learn a lot from it.&lt;br&gt;
And one can put this wheel onto something cooler than a monowheel (http://www.dself.dsl.pipex.com/MUSEUM/TRANSPORT/motorwhl/motorwhl.htm#1)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Why re-invent the wheel?<br />
One will learn a lot from it.<br />
And one can put this wheel onto something cooler than a monowheel (<a href="http://www.dself.dsl.pipex.com/MUSEUM/TRANSPORT/motorwhl/motorwhl.htm#1" rel="nofollow">http://www.dself.dsl.pipex.com/MUSEUM/TRANSPORT/motorwhl/motorwhl.htm#1</a>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2211</link>
		<dc:creator>Dick</dc:creator>
		<pubDate>Wed, 25 Aug 2004 23:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2211</guid>
		<description>&lt;p&gt;Christopher:  Good question.  The example is for a one-shot type workbook.  That is, it&#039;s the only workbook the user will have open.  If you made it the ActiveWorkbook, you would need some event handling to update the control for the sheets in the active book whenever the user switched workbooks.  That&#039;s doable, it&#039;s just a lot more work.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Christopher:  Good question.  The example is for a one-shot type workbook.  That is, it&#8217;s the only workbook the user will have open.  If you made it the ActiveWorkbook, you would need some event handling to update the control for the sheets in the active book whenever the user switched workbooks.  That&#8217;s doable, it&#8217;s just a lot more work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christopher Short</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2210</link>
		<dc:creator>Christopher Short</dc:creator>
		<pubDate>Wed, 25 Aug 2004 06:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2210</guid>
		<description>&lt;p&gt;Why did you choose to use &#039;ThisWorkBook&#039; rather &#039;ActiveWorkBook&#039;?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Why did you choose to use &#8216;ThisWorkBook&#8217; rather &#8216;ActiveWorkBook&#8217;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Murray</title>
		<link>http://www.dailydoseofexcel.com/archives/2004/08/23/sheet-names-in-a-dropdown-on-a-toolbar/#comment-2209</link>
		<dc:creator>Murray</dc:creator>
		<pubDate>Tue, 24 Aug 2004 02:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=732#comment-2209</guid>
		<description>&lt;p&gt;I modified the macro so that I can use my own &quot;name&quot; for the sheet rather than the actual name.  I know that I could just change the name of the worksheet by rightclicking on &quot;rename&quot;, but my workbook is so big it crashes when I try it.  I added the following code in square brackets:&lt;/p&gt;
&lt;p&gt;With cbSheets&lt;br&gt;
        &#039;Add a combobox control&lt;br&gt;
        Set ctDropDown = .Controls.Add(msoControlDropdown)&lt;/p&gt;
&lt;p&gt;        &#039;Populate with sheet names&lt;br&gt;
        For Each oSheet In ThisWorkbook.Sheets&lt;br&gt;
            ctDropDown.AddItem oSheet.Name&lt;/p&gt;
&lt;p&gt;            [If oSheet.Name = &quot;Data&quot; Then&lt;br&gt;
            ctDropDown.AddItem &quot;Collections&quot;&lt;br&gt;
            End If]&lt;br&gt;
        Next oSheet&lt;/p&gt;
&lt;p&gt;and then in Sub ActivateSheet()&lt;/p&gt;
&lt;p&gt;    With Application.CommandBars(sCbName).Controls(1)&lt;br&gt;
        [If .Text = &quot;Collections&quot; Then&lt;br&gt;
        Sheets(&quot;Data&quot;).Activate&lt;br&gt;
        Else]&lt;br&gt;
        ThisWorkbook.Sheets(.Text).Activate&lt;br&gt;
        End If&lt;br&gt;
    End With&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Now I can simulate a &quot;new&quot; name for my Worksheet.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I modified the macro so that I can use my own &#8220;name&#8221; for the sheet rather than the actual name.  I know that I could just change the name of the worksheet by rightclicking on &#8220;rename&#8221;, but my workbook is so big it crashes when I try it.  I added the following code in square brackets:</p>
<p>With cbSheets<br />
        &#8216;Add a combobox control<br />
        Set ctDropDown = .Controls.Add(msoControlDropdown)</p>
<p>        &#8216;Populate with sheet names<br />
        For Each oSheet In ThisWorkbook.Sheets<br />
            ctDropDown.AddItem oSheet.Name</p>
<p>            [If oSheet.Name = "Data" Then<br />
            ctDropDown.AddItem "Collections"<br />
            End If]<br />
        Next oSheet</p>
<p>and then in Sub ActivateSheet()</p>
<p>    With Application.CommandBars(sCbName).Controls(1)<br />
        [If .Text = "Collections" Then<br />
        Sheets("Data").Activate<br />
        Else]<br />
        ThisWorkbook.Sheets(.Text).Activate<br />
        End If<br />
    End With</p>
<p>End Sub</p>
<p>Now I can simulate a &#8220;new&#8221; name for my Worksheet.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

