<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Excel &#38; VBA</title>
	<atom:link href="http://www.exceltips.nl/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.exceltips.nl</link>
	<description>Easy fixes and handy tips..</description>
	<lastBuildDate>Mon, 26 Jul 2010 14:23:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Group/Ungroup in protected worksheets</title>
		<link>http://www.exceltips.nl/?p=152</link>
		<comments>http://www.exceltips.nl/?p=152#comments</comments>
		<pubDate>Mon, 26 Jul 2010 14:23:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBA Snippets]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=152</guid>
		<description><![CDATA[You would have to use a Workbook_Open macro to set the protection a special way when you open the workbook. 
The following needs to go in the ThisWorkbook module. The password is password - you can change the text between the quotation marks to what you need it to be. The sheet with the subtotaling [...]]]></description>
			<content:encoded><![CDATA[<p>You would have to use a Workbook_Open macro to set the protection a special way when you open the workbook. </p>
<p>The following needs to go in the <strong>ThisWorkbook</strong> module. The password is password - you can change the text between the quotation marks to what you need it to be. The sheet with the subtotaling is called sales - you can change that below.</p>
<div class="syntax_hilite">
<div id="vb-2">
<div class="vb"><span style="color: #b1b100;">Private</span> <span style="color: #b1b100;">Sub</span> Workbook_Open<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color: #b1b100;">With</span> Worksheets<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"sales"</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;.<span style="color: #66cc66;">Protect</span> Password:=<span style="color: #ff0000;">"password"</span>, Userinterfaceonly:=<span style="color: #b1b100;">True</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;.<span style="color: #66cc66;">EnableOutlining</span> = <span style="color: #b1b100;">True</span><br />
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">With</span><br />
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=152</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crack Sheet Protection Password</title>
		<link>http://www.exceltips.nl/?p=147</link>
		<comments>http://www.exceltips.nl/?p=147#comments</comments>
		<pubDate>Thu, 20 May 2010 09:26:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBA Snippets]]></category>
		<category><![CDATA[crack]]></category>
		<category><![CDATA[crack hack sheet protection password excel]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[lost]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[sheet]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=147</guid>
		<description><![CDATA[This routine provides a password to unprotect your worksheet. However, it may not give you the original password that was used.
Open the workbook that has the protected sheet in it. Hit Alt+F11 to view the Visual Basic Editor. Hit Insert-Module and paste this code into the right-hand code window:


Sub PasswordBreaker&#40;&#41;
&#160; 'Author unknown but submitted by [...]]]></description>
			<content:encoded><![CDATA[<p>This routine provides a password to unprotect your worksheet. However, it may not give you the original password that was used.</p>
<p>Open the workbook that has the protected sheet in it. Hit Alt+F11 to view the Visual Basic Editor. Hit Insert-Module and paste this code into the right-hand code window:</p>
<div class="syntax_hilite">
<div id="vb-4">
<div class="vb"><span style="color: #b1b100;">Sub</span> PasswordBreaker<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color: #808080;">'Author unknown but submitted by brettdj of www.experts-exchange.com</span><br />
&nbsp; <br />
&nbsp; <span style="color: #b1b100;">Dim</span> i <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, j <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, k <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span><br />
&nbsp; <span style="color: #b1b100;">Dim</span> l <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, m <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, n <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span><br />
&nbsp; <span style="color: #b1b100;">Dim</span> i1 <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, i2 <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, i3 <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span><br />
&nbsp; <span style="color: #b1b100;">Dim</span> i4 <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, i5 <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span>, i6 <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span><br />
&nbsp; <span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Resume</span> <span style="color: #b1b100;">Next</span><br />
&nbsp; <span style="color: #b1b100;">For</span> i = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> j = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> k = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span><br />
&nbsp; <span style="color: #b1b100;">For</span> l = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> m = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> i1 = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span><br />
&nbsp; <span style="color: #b1b100;">For</span> i2 = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> i3 = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> i4 = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span><br />
&nbsp; <span style="color: #b1b100;">For</span> i5 = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> i6 = <span style="color: #cc66cc;">65</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">66</span>: <span style="color: #b1b100;">For</span> n = <span style="color: #cc66cc;">32</span> <span style="color: #b1b100;">To</span> <span style="color: #cc66cc;">126</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;ActiveSheet.<span style="color: #66cc66;">Unprotect</span> <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>j<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>k<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; _<br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>l<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>m<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i1<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i2<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i3<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; _<br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i4<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i5<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i6<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; <span style="color: #b1b100;">If</span> ActiveSheet.<span style="color: #66cc66;">ProtectContents</span> = <span style="color: #b1b100;">False</span> <span style="color: #b1b100;">Then</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">MsgBox</span> <span style="color: #ff0000;">"One usable password is "</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>j<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>k<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>l<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>m<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i1<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i2<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i3<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i4<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i5<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i6<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp;ActiveWorkbook.<span style="color: #66cc66;">Sheets</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Select</span><br />
&nbsp; &nbsp;Range<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"a1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">FormulaR1C1</span> = <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>j<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>k<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>l<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>m<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i1<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i2<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i3<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i4<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i5<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>i6<span style="color:#006600; font-weight:bold;">&#41;</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span>n<span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">Exit</span> <span style="color: #b1b100;">Sub</span><br />
&nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span><br />
&nbsp; <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span><br />
&nbsp; <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span>: <span style="color: #b1b100;">Next</span></p>
<p>
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span></div>
</div>
</div>
<p></p>
<p>Close the VB Editor window. Navigate to the worksheet you want to unprotect. Hit Tools-Macro-Macros and double-click PasswordBreaker in the list.</p>
<p>Source: <a href="http://www.theofficeexperts.com/VBASamples/Excel02.htm">http://www.theofficeexperts.com/VBASamples/Excel02.htm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=147</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display sheetname in cell formula</title>
		<link>http://www.exceltips.nl/?p=145</link>
		<comments>http://www.exceltips.nl/?p=145#comments</comments>
		<pubDate>Thu, 18 Feb 2010 10:23:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Excel Formulas]]></category>
		<category><![CDATA[active]]></category>
		<category><![CDATA[cell]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[name]]></category>
		<category><![CDATA[sheet]]></category>
		<category><![CDATA[value]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=145</guid>
		<description><![CDATA[=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)
]]></description>
			<content:encoded><![CDATA[<p>=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=145</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excel Diet: Reduce file size of excel workbook</title>
		<link>http://www.exceltips.nl/?p=142</link>
		<comments>http://www.exceltips.nl/?p=142#comments</comments>
		<pubDate>Thu, 22 Oct 2009 14:23:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBA Snippets]]></category>
		<category><![CDATA[diet]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[filesize]]></category>
		<category><![CDATA[reduce]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[workbook]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=142</guid>
		<description><![CDATA[

Option Explicit 
&#160;
Sub ExcelDiet&#40;&#41; 
&#160; &#160; &#160;
&#160; &#160; Dim j&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;As Long 
&#160; &#160; Dim k&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;As Long 
&#160; &#160; Dim LastRow&#160; &#160; &#160; &#160; &#160;As Long 
&#160; &#160; Dim LastCol&#160; &#160; &#160; &#160; &#160;As Long 
&#160; &#160; Dim ColFormula&#160; &#160; &#160; As [...]]]></description>
			<content:encoded><![CDATA[<div class="syntax_hilite">
<div id="vb-6">
<div class="vb"><span style="color: #b1b100;">Option</span> <span style="color: #b1b100;">Explicit</span> <br />
&nbsp;<br />
<span style="color: #b1b100;">Sub</span> ExcelDiet<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> j&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> k&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> LastRow&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> LastCol&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Long</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> ColFormula&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">As</span> Range <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> RowFormula&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">As</span> Range <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> ColValue&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">As</span> Range <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> RowValue&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">As</span> Range <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> Shp&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">As</span> Shape <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Dim</span> ws&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">As</span> Worksheet <br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; Application.<span style="color: #66cc66;">ScreenUpdating</span> = <span style="color: #b1b100;">False</span> <br />
&nbsp; &nbsp; Application.<span style="color: #66cc66;">DisplayAlerts</span> = <span style="color: #b1b100;">False</span> <br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Resume</span> <span style="color: #b1b100;">Next</span> <br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">For</span> Each ws In Worksheets <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">With</span> ws <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">'Find the last used cell with a formula and value</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">'Search by Columns and Rows</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Resume</span> <span style="color: #b1b100;">Next</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Set</span> ColFormula = .<span style="color: #66cc66;">Cells</span>.<span style="color: #66cc66;">Find</span><span style="color:#006600; font-weight:bold;">&#40;</span>What:=<span style="color: #ff0000;">"*"</span>, After:=Range<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"A1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, LookIn:=xlFormulas, _ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious<span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Set</span> ColValue = .<span style="color: #66cc66;">Cells</span>.<span style="color: #66cc66;">Find</span><span style="color:#006600; font-weight:bold;">&#40;</span>What:=<span style="color: #ff0000;">"*"</span>, After:=Range<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"A1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, LookIn:=xlValues, _ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious<span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Set</span> RowFormula = .<span style="color: #66cc66;">Cells</span>.<span style="color: #66cc66;">Find</span><span style="color:#006600; font-weight:bold;">&#40;</span>What:=<span style="color: #ff0000;">"*"</span>, After:=Range<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"A1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, LookIn:=xlFormulas, _ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious<span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Set</span> RowValue = .<span style="color: #66cc66;">Cells</span>.<span style="color: #66cc66;">Find</span><span style="color:#006600; font-weight:bold;">&#40;</span>What:=<span style="color: #ff0000;">"*"</span>, After:=Range<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"A1"</span><span style="color:#006600; font-weight:bold;">&#41;</span>, LookIn:=xlValues, _ <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious<span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Goto</span> <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">'Determine the last column</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> ColFormula Is <span style="color: #b1b100;">Nothing</span> <span style="color: #b1b100;">Then</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastCol = <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Else</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastCol = ColFormula.<span style="color: #66cc66;">Column</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> <span style="color: #b1b100;">Not</span> ColValue Is <span style="color: #b1b100;">Nothing</span> <span style="color: #b1b100;">Then</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastCol = Application.<span style="color: #66cc66;">WorksheetFunction</span>.<span style="color: #b1b100;">Max</span><span style="color:#006600; font-weight:bold;">&#40;</span>LastCol, ColValue.<span style="color: #66cc66;">Column</span><span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">'Determine the last row</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> RowFormula Is <span style="color: #b1b100;">Nothing</span> <span style="color: #b1b100;">Then</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastRow = <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Else</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastRow = RowFormula.<span style="color: #66cc66;">Row</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> <span style="color: #b1b100;">Not</span> RowValue Is <span style="color: #b1b100;">Nothing</span> <span style="color: #b1b100;">Then</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastRow = Application.<span style="color: #66cc66;">WorksheetFunction</span>.<span style="color: #b1b100;">Max</span><span style="color:#006600; font-weight:bold;">&#40;</span>LastRow, RowValue.<span style="color: #66cc66;">Row</span><span style="color:#006600; font-weight:bold;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #808080;">'Determine if any shapes are beyond the last row and last column</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">For</span> Each Shp In .<span style="color: #66cc66;">Shapes</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j = <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k = <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Resume</span> <span style="color: #b1b100;">Next</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j = Shp.<span style="color: #66cc66;">TopLeftCell</span>.<span style="color: #66cc66;">Row</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k = Shp.<span style="color: #66cc66;">TopLeftCell</span>.<span style="color: #66cc66;">Column</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Goto</span> <span style="color: #cc66cc;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> j&gt; <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">And</span> k&gt; <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">Then</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Do</span> Until .<span style="color: #66cc66;">Cells</span><span style="color:#006600; font-weight:bold;">&#40;</span>j, k<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Top</span>&gt; Shp.<span style="color: #66cc66;">Top</span> + Shp.<span style="color: #66cc66;">Height</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; j = j + <span style="color: #cc66cc;">1</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Loop</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> j&gt; LastRow <span style="color: #b1b100;">Then</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastRow = j <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Do</span> Until .<span style="color: #66cc66;">Cells</span><span style="color:#006600; font-weight:bold;">&#40;</span>j, k<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Left</span>&gt; Shp.<span style="color: #b1b100;">Left</span> + Shp.<span style="color: #b1b100;">Width</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; k = k + <span style="color: #cc66cc;">1</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Loop</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> k&gt; LastCol <span style="color: #b1b100;">Then</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LastCol = k <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Next</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #66cc66;">Range</span><span style="color:#006600; font-weight:bold;">&#40;</span>Cells<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;">1</span>, LastCol + <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Address</span> &amp; <span style="color: #ff0000;">":IV65536"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Delete</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span style="color: #66cc66;">Range</span><span style="color:#006600; font-weight:bold;">&#40;</span>Cells<span style="color:#006600; font-weight:bold;">&#40;</span>LastRow + <span style="color: #cc66cc;">1</span>, <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Address</span> &amp; <span style="color: #ff0000;">":IV65536"</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Delete</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">With</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">Next</span> <br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; Application.<span style="color: #66cc66;">ScreenUpdating</span> = <span style="color: #b1b100;">True</span> <br />
&nbsp; &nbsp; Application.<span style="color: #66cc66;">DisplayAlerts</span> = <span style="color: #b1b100;">True</span> <br />
&nbsp; &nbsp; &nbsp;<br />
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=142</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Select all visible sheets in a workbook</title>
		<link>http://www.exceltips.nl/?p=131</link>
		<comments>http://www.exceltips.nl/?p=131#comments</comments>
		<pubDate>Mon, 13 Jul 2009 08:00:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBA Snippets]]></category>
		<category><![CDATA[all]]></category>
		<category><![CDATA[only]]></category>
		<category><![CDATA[select]]></category>
		<category><![CDATA[sheets]]></category>
		<category><![CDATA[visible]]></category>
		<category><![CDATA[workbook]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=131</guid>
		<description><![CDATA[

sub select_visible_sheets &#40;&#41;
&#160; &#160;Dim ws As Worksheet
&#160; &#160;
&#160; &#160; For Each ws In Sheets
&#160; &#160; &#160; &#160; If ws.Name &#60;&#62; "SOURCE DATA" And ws.Visible Then ws.Select &#40;False&#41;
&#160; &#160; Next
End Sub



]]></description>
			<content:encoded><![CDATA[<div class="syntax_hilite">
<div id="vb-8">
<div class="vb"><span style="color: #b1b100;">sub</span> select_visible_sheets <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #b1b100;">Dim</span> ws <span style="color: #b1b100;">As</span> Worksheet<br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; <span style="color: #b1b100;">For</span> Each ws In Sheets<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> ws.<span style="color: #b1b100;">Name</span> &lt;&gt; <span style="color: #ff0000;">"SOURCE DATA"</span> <span style="color: #b1b100;">And</span> ws.<span style="color: #66cc66;">Visible</span> <span style="color: #b1b100;">Then</span> ws.<span style="color: #66cc66;">Select</span> <span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #b1b100;">False</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">Next</span><br />
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=131</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide zero value lines within a pivot table in Excel 2003/XP/2000/97</title>
		<link>http://www.exceltips.nl/?p=126</link>
		<comments>http://www.exceltips.nl/?p=126#comments</comments>
		<pubDate>Thu, 09 Jul 2009 12:46:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Excel Tips & Tricks]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[hide]]></category>
		<category><![CDATA[lines]]></category>
		<category><![CDATA[pivot]]></category>
		<category><![CDATA[zero]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=126</guid>
		<description><![CDATA[Great article with screenshots.. Doesnt get any clearer than this:
Spreadsheet123.com
Too bad it doesnt work for rows adding up to 0 in the pivot (say source has a -10 and 10, so the pivot shows 0, the trick above doesn't work for that)..
]]></description>
			<content:encoded><![CDATA[<p>Great article with screenshots.. Doesnt get any clearer than this:</p>
<p><a href="http://www.spreadsheet123.com/excel_tut/excel_tech_on_net/pivottbls/hide_blanks.html">Spreadsheet123.com</a></p>
<p>Too bad it doesnt work for rows adding up to 0 in the pivot (say source has a -10 and 10, so the pivot shows 0, the trick above doesn't work for that)..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=126</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use a &#8216;check&#8217; symbol in Excel</title>
		<link>http://www.exceltips.nl/?p=124</link>
		<comments>http://www.exceltips.nl/?p=124#comments</comments>
		<pubDate>Tue, 30 Jun 2009 08:48:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Excel Tips & Tricks]]></category>
		<category><![CDATA[check]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[mark]]></category>
		<category><![CDATA[sign]]></category>
		<category><![CDATA[symbol]]></category>
		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=124</guid>
		<description><![CDATA[Set font to Wingdings, and use ALT+0252..
So simple, but took me a while to get it  
]]></description>
			<content:encoded><![CDATA[<p>Set font to Wingdings, and use ALT+0252..</p>
<p>So simple, but took me a while to get it <img src='http://www.exceltips.nl/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macro to sort sheets in a workbook</title>
		<link>http://www.exceltips.nl/?p=122</link>
		<comments>http://www.exceltips.nl/?p=122#comments</comments>
		<pubDate>Sun, 07 Jun 2009 13:49:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBA Snippets]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[sheets]]></category>
		<category><![CDATA[sort]]></category>
		<category><![CDATA[vba]]></category>
		<category><![CDATA[workbook]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=122</guid>
		<description><![CDATA[

Sub Sort_Active_Book&#40;&#41;
Dim i As Integer
Dim j As Integer
Dim iAnswer As VbMsgBoxResult
'
' Prompt the user as which direction they wish to
' sort the worksheets.
'
&#160; &#160;iAnswer = MsgBox&#40;"Sort Sheets in Ascending Order?" &#38; Chr&#40;10&#41; _
&#160; &#160; &#160;&#38; "Clicking No will sort in Descending Order", _
&#160; &#160; &#160;vbYesNoCancel + vbQuestion + vbDefaultButton1, "Sort Worksheets"&#41;
&#160; &#160;For i = 1 [...]]]></description>
			<content:encoded><![CDATA[<div class="syntax_hilite">
<div id="vb-10">
<div class="vb"><span style="color: #b1b100;">Sub</span> Sort_Active_Book<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color: #b1b100;">Dim</span> i <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span><br />
<span style="color: #b1b100;">Dim</span> j <span style="color: #b1b100;">As</span> <span style="color: #b1b100;">Integer</span><br />
<span style="color: #b1b100;">Dim</span> iAnswer <span style="color: #b1b100;">As</span> VbMsgBoxResult<br />
<span style="color: #808080;">'</span><br />
<span style="color: #808080;">' Prompt the user as which direction they wish to</span><br />
<span style="color: #808080;">' sort the worksheets.</span><br />
<span style="color: #808080;">'</span><br />
&nbsp; &nbsp;iAnswer = <span style="color: #b1b100;">MsgBox</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #ff0000;">"Sort Sheets in Ascending Order?"</span> &amp; <span style="color: #b1b100;">Chr</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span> _<br />
&nbsp; &nbsp; &nbsp;&amp; <span style="color: #ff0000;">"Clicking No will sort in Descending Order"</span>, _<br />
&nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">vbYesNoCancel</span> + <span style="color: #b1b100;">vbQuestion</span> + <span style="color: #b1b100;">vbDefaultButton1</span>, <span style="color: #ff0000;">"Sort Worksheets"</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #b1b100;">For</span> i = <span style="color: #cc66cc;">1</span> <span style="color: #b1b100;">To</span> Sheets.<span style="color: #b1b100;">Count</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">For</span> j = <span style="color: #cc66cc;">1</span> <span style="color: #b1b100;">To</span> Sheets.<span style="color: #b1b100;">Count</span> - <span style="color: #cc66cc;">1</span><br />
<span style="color: #808080;">'</span><br />
<span style="color: #808080;">' If the answer is Yes, then sort in ascending order.</span><br />
<span style="color: #808080;">'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">If</span> iAnswer = <span style="color: #b1b100;">vbYes</span> <span style="color: #b1b100;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> <span style="color: #b1b100;">UCase</span>$<span style="color:#006600; font-weight:bold;">&#40;</span>Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #b1b100;">Name</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt; <span style="color: #b1b100;">UCase</span>$<span style="color:#006600; font-weight:bold;">&#40;</span>Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j + <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #b1b100;">Name</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #b1b100;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Move</span> After:=Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j + <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span><br />
<span style="color: #808080;">'</span><br />
<span style="color: #808080;">' If the answer is No, then sort in descending order.</span><br />
<span style="color: #808080;">'</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">ElseIf</span> iAnswer = <span style="color: #b1b100;">vbNo</span> <span style="color: #b1b100;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">If</span> <span style="color: #b1b100;">UCase</span>$<span style="color:#006600; font-weight:bold;">&#40;</span>Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #b1b100;">Name</span><span style="color:#006600; font-weight:bold;">&#41;</span> &lt;UCase$<span style="color:#006600; font-weight:bold;">&#40;</span>Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j + <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #b1b100;">Name</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color: #b1b100;">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color: #66cc66;">Move</span> After:=Sheets<span style="color:#006600; font-weight:bold;">&#40;</span>j + <span style="color: #cc66cc;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">If</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">Next</span> j<br />
&nbsp; &nbsp;<span style="color: #b1b100;">Next</span> i<br />
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=122</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Round a figure to the nearest / highest 10,100,500 etc.</title>
		<link>http://www.exceltips.nl/?p=119</link>
		<comments>http://www.exceltips.nl/?p=119#comments</comments>
		<pubDate>Sun, 07 Jun 2009 09:54:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Excel Formulas]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[formula]]></category>
		<category><![CDATA[highest]]></category>
		<category><![CDATA[nearest]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[round]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=119</guid>
		<description><![CDATA[If the number is in A2 just use this formula
To round to the NEAREST 500:   (eg. 524 rounds to 500)
=ROUND(A2/500,0)*500
To round to the NEXT HIGHEST 500:   (eg. 524 rounds to 1000)
=CEILING(A2,500)
]]></description>
			<content:encoded><![CDATA[<p>If the number is in A2 just use this formula</p>
<p>To round to the NEAREST 500:   (eg. 524 rounds to 500)<br />
<strong>=ROUND(A2/500,0)*500</strong></p>
<p>To round to the NEXT HIGHEST 500:   (eg. 524 rounds to 1000)<br />
<strong>=CEILING(A2,500)</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=119</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Update all pivot tables in a workbook</title>
		<link>http://www.exceltips.nl/?p=109</link>
		<comments>http://www.exceltips.nl/?p=109#comments</comments>
		<pubDate>Thu, 28 May 2009 09:53:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[VBA Snippets]]></category>
		<category><![CDATA[all]]></category>
		<category><![CDATA[automated]]></category>
		<category><![CDATA[excel]]></category>
		<category><![CDATA[in]]></category>
		<category><![CDATA[pivot]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[vba]]></category>
		<category><![CDATA[workbook]]></category>

		<guid isPermaLink="false">http://www.exceltips.nl/?p=109</guid>
		<description><![CDATA[

Option Explicit
Sub RefreshAllPivots&#40;&#41;
Dim ws As Worksheet
Dim pt As PivotTable
On Error Resume Next
For Each ws In ActiveWorkbook.Worksheets
&#160; &#160;For Each pt In ws.PivotTables
&#160; &#160; &#160;pt.RefreshTable
&#160; &#160;Next
Next
End Sub



]]></description>
			<content:encoded><![CDATA[<div class="syntax_hilite">
<div id="vb-12">
<div class="vb"><span style="color: #b1b100;">Option</span> <span style="color: #b1b100;">Explicit</span></p>
<p><span style="color: #b1b100;">Sub</span> RefreshAllPivots<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
<span style="color: #b1b100;">Dim</span> ws <span style="color: #b1b100;">As</span> Worksheet<br />
<span style="color: #b1b100;">Dim</span> pt <span style="color: #b1b100;">As</span> PivotTable</p>
<p><span style="color: #b1b100;">On</span> <span style="color: #b1b100;">Error</span> <span style="color: #b1b100;">Resume</span> <span style="color: #b1b100;">Next</span><br />
<span style="color: #b1b100;">For</span> Each ws In ActiveWorkbook.<span style="color: #66cc66;">Worksheets</span><br />
&nbsp; &nbsp;<span style="color: #b1b100;">For</span> Each pt In ws.<span style="color: #66cc66;">PivotTables</span><br />
&nbsp; &nbsp; &nbsp;pt.<span style="color: #66cc66;">RefreshTable</span><br />
&nbsp; &nbsp;<span style="color: #b1b100;">Next</span><br />
<span style="color: #b1b100;">Next</span><br />
<span style="color: #b1b100;">End</span> <span style="color: #b1b100;">Sub</span></div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.exceltips.nl/?feed=rss2&amp;p=109</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
