<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Code For Excel And Outlook Blog</title>
	
	<link>http://www.codeforexcelandoutlook.com/blog</link>
	<description>Automation and interop VBA code samples for MS Excel and Outlook</description>
	<lastBuildDate>Mon, 06 Jul 2009 12:47:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /><image><link>http://www.codeforexcelandoutlook.com/blog/</link><url>http://feeds2.feedburner.com/~fc/codeforexcelandoutlook/kylx?bg=FF9900&amp;amp;fg=000000&amp;amp;anim=0</url><title>Logo</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/codeforexcelandoutlook/kylx" type="application/rss+xml" /><feedburner:emailServiceId>codeforexcelandoutlook/kylx</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcodeforexcelandoutlook%2Fkylx" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcodeforexcelandoutlook%2Fkylx" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcodeforexcelandoutlook%2Fkylx" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/codeforexcelandoutlook/kylx" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fcodeforexcelandoutlook%2Fkylx" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fcodeforexcelandoutlook%2Fkylx" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fcodeforexcelandoutlook%2Fkylx" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://www.addtoany.com/?linkname=Code%20For%20Excel%20And%20Outlook%20Blog&amp;linkurl=http%3A%2F%2Ffeeds.feedburner.com%2Fcodeforexcelandoutlook%2Fkylx&amp;type=feed" src="http://www.addtoany.com/addfr-b.gif">Add to Any Feed Reader</feedburner:feedFlare><feedburner:browserFriendly>Thanks for viewing my feed. If you would like to subscribe, the options on this page are available for you to add this feed to whatever reader you choose.</feedburner:browserFriendly><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Advanced Excel Conference Recap</title>
		<link>http://feedproxy.google.com/~r/codeforexcelandoutlook/kylx/~3/4ZZGiWjT9rc/</link>
		<comments>http://www.codeforexcelandoutlook.com/blog/2009/07/advanced-excel-conference-recap/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 11:30:54 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[training]]></category>

		<guid isPermaLink="false">http://www.codeforexcelandoutlook.com/blog/?p=650</guid>
		<description>&amp;#160;&amp;#160;&amp;#160;&amp;#160;I attended this year's Advanced Excel Conference. There were presentations by Bob Umlas and Jon Peltier, Excel MVPs. See link for topics list.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;This year's conference was different from last year's in the following ways:

I didn't eat at Burger King on the way to Atlantic City. Or on the way home.
Red Bull and Vitamin Water (Energy) [...]&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
This post is from : &lt;a href="http://www.codeforexcelandoutlook.com/blog/"&gt;Code For Excel And Outlook Blog&lt;/a&gt;. Copyright &amp;copy; Code For Excel And Outlook.
&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://www.exceluser.com/cmd.asp?af=928709"&gt;Do you need plug-and-play Excel Dashboards?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeforexcelandoutlook.com/blog/2009/07/advanced-excel-conference-recap/"&gt;Advanced Excel Conference Recap&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;I attended this year's <a href="http://peltiertech.com/Training/2009-06-ACNJ/AdvExcelConf200906ACNJ.html">Advanced Excel Conference</a>. There were presentations by Bob Umlas and Jon Peltier, Excel MVPs. See link for topics list.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;This year's conference was different from last year's in the following ways:</p>
<ul>
<li>I didn't eat at Burger King on the way to Atlantic City. Or on the way home.</li>
<li>Red Bull and Vitamin Water (Energy) help you stay awake on the road.</li>
<li>I have a much better job than I did last time. They don't offer paid vacation, but I can come and go as I please (more or less).</li>
<li>I attended the full conference (both days).</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;The weather was terrible; it's still cloudy and raining in New York to this day. But as we were indoors most of the time, it didn't matter. The only time I went out was for dinner on Wednesday night, when most of the group went to an Irish pub inside the Tropicana hotel. Food was great, drinking beer and talking about Excel and Access was a lot of fun.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;I got there on Tuesday the 16th around 11:30 pm, same as last year. The conference started at 8:30 on Wednesday morning. Bob spoke until about 12, then Jon took over at 1 pm until about 5. Thursday was the reverse; Jon started and then after lunch, Bob presented until 5pm. My laptop actually decided to cooperate and work most of the time; last time, the monitor kept powering down.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Instead of CDs with the presentation spreadsheets on them, Jon passed around a USB drive with the files on them. It worked really well because you just insert the drive into an available USB port, then drag and drop the files over. And there were a lot of files. Bob used a different spreadsheet for each topic, so there were about 25 or so for his Intermediate VBA class. Jon used a single workbook with multiple worksheets.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;I also met a few people I correspond with online, including <a href="http://twitter.com/rschinzel">Ray Schinzel</a> and <a href="http://www.linkedin.com/in/alfredvachris">Al Vachris</a>.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Overall, a very good experience, and worth the money. I learned a lot about the Range object from Bob, and charting is much easier thanks to Jon's presentation (which I missed last year).</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Gas prices, on the other hand, have remained high. Hopefully this will change for next year's conference.</p>
<p><br /><br /><br />
This post is from : <a href="http://www.codeforexcelandoutlook.com/blog/">Code For Excel And Outlook Blog</a>. Copyright &copy; Code For Excel And Outlook.
<br /><br />
<a href="http://www.exceluser.com/cmd.asp?af=928709">Do you need plug-and-play Excel Dashboards?</a></p>
<p><a href="http://www.codeforexcelandoutlook.com/blog/2009/07/advanced-excel-conference-recap/">Advanced Excel Conference Recap</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?a=4ZZGiWjT9rc:FO4uccKvotE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?i=4ZZGiWjT9rc:FO4uccKvotE:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codeforexcelandoutlook/kylx/~4/4ZZGiWjT9rc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codeforexcelandoutlook.com/blog/2009/07/advanced-excel-conference-recap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.codeforexcelandoutlook.com/blog/2009/07/advanced-excel-conference-recap/</feedburner:origLink></item>
		<item>
		<title>Need Ribbon help? You're not alone.</title>
		<link>http://feedproxy.google.com/~r/codeforexcelandoutlook/kylx/~3/_9UC0-CfVYE/</link>
		<comments>http://www.codeforexcelandoutlook.com/blog/2009/07/need-ribbon-help-youre-not-alone/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 14:23:41 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.codeforexcelandoutlook.com/blog/?p=654</guid>
		<description>&amp;#160;&amp;#160;&amp;#160;&amp;#160;Today on TechRepublic's Microsoft Office blog, Susan Harkins mentions an add-in for several Office 2007 products that helps you find menu commands.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Say what? 
&amp;#160;&amp;#160;&amp;#160;&amp;#160;You need an additional product for that?
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Sorry, but there's something wrong when you have to use an add-in to search for commands in one of the most popular programs of all time. [...]&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
This post is from : &lt;a href="http://www.codeforexcelandoutlook.com/blog/"&gt;Code For Excel And Outlook Blog&lt;/a&gt;. Copyright &amp;copy; Code For Excel And Outlook.
&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://www.exceluser.com/cmd.asp?af=928709"&gt;Do you need plug-and-play Excel Dashboards?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeforexcelandoutlook.com/blog/2009/07/need-ribbon-help-youre-not-alone/"&gt;Need Ribbon help? You're not alone.&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;Today on TechRepublic's <a href="http://blogs.techrepublic.com.com/msoffice/wp-rss2.php">Microsoft Office blog</a>, Susan Harkins mentions an add-in for several Office 2007 products that helps you find menu commands.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Say what? </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;You need an additional product for that?</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Sorry, but there's something wrong when you have to use an add-in to search for commands <em>in one of the most popular programs of all time</em>. It reminds me of how there are certain WordPress features missing from the standard install, yet desperately needed (like <a href="http://www.codinghorror.com/blog/archives/001105.html">built-in caching</a>). I feel bad for Office 2007 power users who are disoriented by the new menus.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Isn't it sad that you have to install an add-in to use a product's core functionality?</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Here's the tagline from the add-in's homepage at <a href="http://www.officelabs.com/projects/searchcommands/Pages/default.aspx">Office Labs</a>: "You know there’s a button for it, but you don’t know or remember where it is." </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Maybe that's because <strong>you moved it</strong>. Why does a phrase like that even apply to a piece of software? If you have to utter a sentence like that, there's something wrong with your product.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;I've never seen so much time spent tweaking a user interface. How many productive hours have been lost? There are add-ins and commercial products and books and tutorial pages dedicated to rearranging elements of the UI or helping you to make it look like Excel 2003. Does anyone do this with 2003, or do you just add a few commands to an existing toolbar (if necessary)?</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;As for the Ribbon's effect on productivity, I leave for others to decide. But <a href="http://www.exceluser.com/explore/surveys/ribbon/ribbon-survey-results.htm">here's a great article about it</a>.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Simon Murphy has a series of posts about the Excel Ribbon, the latest of which is <a href="http://smurfonspreadsheets.wordpress.com/2009/07/03/ribbon-style-princess/">Ribbon Style Princess</a> which highlights more UI woes. I'd love to hear from anyone out there, agree or disagree.</p>
<p><br /><br /><br />
This post is from : <a href="http://www.codeforexcelandoutlook.com/blog/">Code For Excel And Outlook Blog</a>. Copyright &copy; Code For Excel And Outlook.
<br /><br />
<a href="http://www.exceluser.com/cmd.asp?af=928709">Do you need plug-and-play Excel Dashboards?</a></p>
<p><a href="http://www.codeforexcelandoutlook.com/blog/2009/07/need-ribbon-help-youre-not-alone/">Need Ribbon help? You're not alone.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?a=_9UC0-CfVYE:7OCqzsCegks:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?i=_9UC0-CfVYE:7OCqzsCegks:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codeforexcelandoutlook/kylx/~4/_9UC0-CfVYE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codeforexcelandoutlook.com/blog/2009/07/need-ribbon-help-youre-not-alone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.codeforexcelandoutlook.com/blog/2009/07/need-ribbon-help-youre-not-alone/</feedburner:origLink></item>
		<item>
		<title>Q2 Stats Wrap Up</title>
		<link>http://feedproxy.google.com/~r/codeforexcelandoutlook/kylx/~3/gzzKr12rIm8/</link>
		<comments>http://www.codeforexcelandoutlook.com/blog/2009/07/q2-stats-wrap-up/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 11:30:46 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Administrative]]></category>
		<category><![CDATA[stats]]></category>

		<guid isPermaLink="false">http://www.codeforexcelandoutlook.com/blog/?p=651</guid>
		<description>&amp;#160;&amp;#160;&amp;#160;&amp;#160;Quarter 2 of this year has passed, and here are the highlights of the last three months.
Visits
&amp;#160;&amp;#160;&amp;#160;&amp;#160;The site had 800 visitors on June 25th, the most for a single day this past quarter, and seems to be consistently producing numbers in the mid-600 to 700 range on a daily basis. There was a slight drop [...]&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
This post is from : &lt;a href="http://www.codeforexcelandoutlook.com/blog/"&gt;Code For Excel And Outlook Blog&lt;/a&gt;. Copyright &amp;copy; Code For Excel And Outlook.
&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://www.exceluser.com/cmd.asp?af=928709"&gt;Do you need plug-and-play Excel Dashboards?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeforexcelandoutlook.com/blog/2009/07/q2-stats-wrap-up/"&gt;Q2 Stats Wrap Up&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;Quarter 2 of this year has passed, and here are the highlights of the last three months.</p>
<h2>Visits</h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;The site had 800 visitors on June 25th, the most for a single day this past quarter, and seems to be consistently producing numbers in the mid-600 to 700 range on a daily basis. There was a slight drop in overall traffic when I switched the main site to use WordPress as a CMS, but finally seems to be recovering in the last week or so.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;The <a href="http://www.codeforexcelandoutlook.com/SearchBox.html">VBA Search Engine</a> hit 400 sites (<a href="http://www.codeforexcelandoutlook.com/blog/2008/04/contribute-to-this-site/">become a volunteer contributor</a>), and we're very close to 200 blog posts and 800 feed subscribers.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;As usual, the most popular pages were the <a href="http://www.codeforexcelandoutlook.com/blog/">blog homepage</a>, the <a href="http://www.codeforexcelandoutlook.com/excel-vba/">Excel page</a> and the <a href="http://www.codeforexcelandoutlook.com/outlook-vba/">Outlook page</a>.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;There were 36 posts and 59 comments/trackbacks (half of the comments were me, I think).</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Thanks to <a href="http://www.dicks-blog.com/">Dick's blog</a>, the <a href="http://www.codeforexcelandoutlook.com/blog/2009/02/random-sample-data-generator-add-in-for-excel-now-available/">Random Data Generator</a> was by far the most popular page this past quarter. The <a href="http://www.codeforexcelandoutlook.com/blog/add-ins/">Add-Ins page</a> was also very popular during this time.</p>
<h2>Top Referral Sources:</h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;I'd to thank and send some link love to the following sites that top out the list of referring sites for Q2:</p>
<ul>
<li><a href="http://www.excelvbamacro.com/">Excel VBA Macro</a> &#8211; a wonderfully keyword-loaded URL with a useful blog.</li>
<li><a href="http://chandoo.org/wp/">Chandoo</a> and Pointy Haired Dilbert</li>
<li><a href="http://www.spreadsheetpage.com/index.php/blog">John Walkenbach's Spreadsheet Page</a></li>
<li><a href="http://blog.contextures.com/">Debra Dalgleish</a> and her Contextures blog</li>
<li>Jon Peltier's <a href="http://peltiertech.com/WordPress/">PTS Blog</a></li>
<li><a href="http://www.dailydoseofexcel.com/">Daily Dose of Excel</a></li>
<li><a href="http://newtonexcelbach.wordpress.com/">NewtonExcelBach</a></li>
<li><a href="http://www.excelguru.ca/blog">Excel Guru</a> Ken Puls</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Plus some new friends at accessclub.jp and utteraccess.com, who seem to be paying visits more frequently. I attribute that to the <a href="http://www.codeforexcelandoutlook.com/blog/category/access/">Access code samples</a> I've been posting.</p>
<h2>Add-Ins</h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;To save bandwidth, I've moved the add-ins to Amazon's S3 service. The download traffic was extremely high last month, so I also decided to move all the images to Photo Bucket. It seems to be working, and the site is faster with PHP compression (take that, mod_deflate!). So much so that I was able to turn off WP-Super Cache. (I don't think I configured it properly anyway.) If I see the bandwidth being abused again (especially the zip files, which third party download sites love to link to), I may move the files back here, and simply block any access to zip files if there's no valid referrer from this site.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;The add-in download traffic was brisk, both from here and from <a rel="nofollow" href="http://download.cnet.com/windows/">download.com</a>. Here is the breakdown. Next quarter it won't be accurate, since Amazon S3 doesn't show you which files were downloaded.</p>
<h3>April add-in downloads</h3>
<ul>
<li>Random Data Generator &#8211; 441 downloads</li>
<li>Post To Twitter &#8211; 250 downloads</li>
<li>ShipTrack (and UI) &#8211; 127 downloads</li>
<li>Data Filter Tool &#8211; 298 downloads</li>
<li>SheetPicker &#8211; 108 downloads</li>
<li>Amazon Ad Link Generator &#8211; 29 downloads</li>
<li>Bingo Number Generator (.NET version) &#8211; 5 downloads</li>
</ul>
<h3>May add-in downloads</h3>
<ul>
<li>Random Data Generator &#8211; 340 downloads</li>
<li>Post To Twitter &#8211; 117 downloads</li>
<li>ShipTrack (and UI) &#8211; 138 downloads</li>
<li>Data Filter Tool &#8211; 159 downloads</li>
<li>SheetPicker &#8211; 56 downloads</li>
<li>Amazon Ad Link Generator &#8211; 29 downloads</li>
<li>Bingo Number Generator (.NET version) &#8211; 4 downloads</li>
</ul>
<h3>June add-in downloads</h3>
<ul>
<li>Random Data Generator &#8211; 217 downloads</li>
<li>Post To Twitter &#8211; 94 downloads</li>
<li>ShipTrack (and UI) &#8211; 114 downloads</li>
<li>Data Filter Tool &#8211; 106 downloads</li>
<li>SheetPicker &#8211; 21 downloads</li>
<li>Amazon Ad Link Generator &#8211; 19 downloads</li>
<li>Bingo Number Generator (.NET version) &#8211; 11 downloads</li>
</ul>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Visit the <a href="http://www.codeforexcelandoutlook.com/blog/add-ins/">Add-Ins page</a> to download any of these Excel add-ins.</p>
<h2>Other News</h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Several DMCA complaints were successfully filed with ISPs that hosted download sites that for some unknown reason felt very comfortable taking my add-ins without asking and putting them up for download on their own sites. The site owners, who live in Hungary, China, and other eastern locations, choose to host their sites in the U.S.A., where we have laws against that. A few form letters, combined with a few .htaccess tweaks, should prevent any more incidents.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Coming soon (<em>read: six months</em>) I'll have a standalone version (VB .NET) of the Random Data Generator which will export to Excel/Access/CSV and be available for purchase.</p>
<h2>Stats Mania!</h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Seems everyone's getting into the stats mood. My timeline might be wrong, but I believe Chandoo started it, then J-Walk posted his, then Dick, then Jon.</p>
<p><a href="http://chandoo.org/wp/2009/07/01/best-month-ever/">Best month ever</a><br />
<a href="http://spreadsheetpage.com/index.php/comments/visitor_stats/">Visitor Stats</a><br />
<a href="http://www.dailydoseofexcel.com/archives/2009/07/01/june-stats/">June Stats</a><br />
<a href="http://peltiertech.com/WordPress/web-stats-june-2009/">Web Stats &#8211; June 2009</a></p>
<p>And <a href="http://blog.contextures.com/archives/2009/07/02/200906-site-stats/">Debra from Contextures</a> also posted hers.</p>
<p><br /><br /><br />
This post is from : <a href="http://www.codeforexcelandoutlook.com/blog/">Code For Excel And Outlook Blog</a>. Copyright &copy; Code For Excel And Outlook.
<br /><br />
<a href="http://www.exceluser.com/cmd.asp?af=928709">Do you need plug-and-play Excel Dashboards?</a></p>
<p><a href="http://www.codeforexcelandoutlook.com/blog/2009/07/q2-stats-wrap-up/">Q2 Stats Wrap Up</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?a=gzzKr12rIm8:9rqsqAi5NKE:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?i=gzzKr12rIm8:9rqsqAi5NKE:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codeforexcelandoutlook/kylx/~4/gzzKr12rIm8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codeforexcelandoutlook.com/blog/2009/07/q2-stats-wrap-up/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.codeforexcelandoutlook.com/blog/2009/07/q2-stats-wrap-up/</feedburner:origLink></item>
		<item>
		<title>List matching files in a folder, part two</title>
		<link>http://feedproxy.google.com/~r/codeforexcelandoutlook/kylx/~3/hoHO8fY7yao/</link>
		<comments>http://www.codeforexcelandoutlook.com/blog/2009/07/list-matching-files-in-a-folder-part-two/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 19:02:07 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[GetFilesList]]></category>
		<category><![CDATA[GetFileType]]></category>

		<guid isPermaLink="false">http://www.codeforexcelandoutlook.com/blog/?p=652</guid>
		<description>&amp;#160;&amp;#160;&amp;#160;&amp;#160;In my previous post titled List matching files in a directory, I posted a method that creates a string array of filenames in a folder that match a given file extension. Here we are going to put that code to some real use.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Don't forget to visit that post and grab the GetFilesList and GetFileType procedures.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Here's [...]&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
This post is from : &lt;a href="http://www.codeforexcelandoutlook.com/blog/"&gt;Code For Excel And Outlook Blog&lt;/a&gt;. Copyright &amp;copy; Code For Excel And Outlook.
&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://www.exceluser.com/cmd.asp?af=928709"&gt;Do you need plug-and-play Excel Dashboards?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeforexcelandoutlook.com/blog/2009/07/list-matching-files-in-a-folder-part-two/"&gt;List matching files in a folder, part two&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;In my previous post titled <a href="http://www.codeforexcelandoutlook.com/blog/2009/06/list-matching-files-in-a-directory/">List matching files in a directory</a>, I posted a method that creates a string array of filenames in a folder that match a given file extension. Here we are going to put that code to some real use.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Don't forget to visit that post and grab the GetFilesList and GetFileType procedures.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Here's the problem: I have a friend who has a column of values on a worksheet. He has a bunch of other workbooks he needs to search for the values in the column, so he has put those workbooks into a separate folder. The challenge? Search each of the workbooks for each of the values in the column, then copy and paste part of the found cell's row next to the value in the original workbook.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Normally I would just use VLOOKUP, INDEX/MATCH or OFFSET to retrieve the value, but the other workbooks have the data all out of order. In other words, the value we're looking for isn't guaranteed to be in a certain column. It could be anywhere on the first worksheet.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Warning: The procedures below are slightly hard coded &#8212; this is a real application after all. <img src='http://www.codeforexcelandoutlook.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;First we'll use the GetFilesList procedure to loop through a specified folder on my friend's desktop and create a string array of workbook names.</p>
<div class="codecolorer-container vb " style="overflow:auto;white-space:nowrap;width:600px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="vb codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">Sub</span> FindWorkbookData()<br />
<br />
<span class="kw1">Dim</span> folder <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> extension <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> dummyString <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> fileslist() <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> i <span class="kw1">As</span> <span class="kw1">Long</span><br />
<br />
folder = Environ(&quot;userprofile&quot;) &amp; &quot;\Desktop\Forms\&quot;<br />
extension = &quot;xls&quot;<br />
<br />
<span class="co1">' build list of Excel files from folder<br />
</span>fileslist = GetFilesList(folder, extension)<br />
<br />
<span class="co1">' check if array is empty (i.e. no files matching extension exist in given folder)<br />
</span><span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">Resume</span> <span class="kw1">Next</span><br />
dummyString = fileslist(0)<br />
<br />
<span class="kw1">If</span> Err &lt;&gt; 0 <span class="kw1">Then</span><br />
&nbsp; MsgBox &quot;No files found <span class="kw1">with</span> &quot; &amp; extension &amp; &quot; extension in&quot; &amp; vbCrLf &amp; folder, vbExclamation<br />
&nbsp; <span class="kw1">Exit</span> <span class="kw1">Sub</span><br />
<span class="kw1">End</span> <span class="kw1">If</span><br />
<span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> 0<br />
<br />
<span class="kw1">For</span> i = 0 <span class="kw1">To</span> <span class="kw1">UBound</span>(fileslist)<br />
&nbsp; <span class="kw1">Call</span> ProcessFile(fileslist(i))<br />
<span class="kw1">Next</span> i<br />
<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div></td></tr></tbody></table></div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Once we have the array of names, we call a custom function called ProcessFile which takes a string argument. In this case, we want to process each of the spreadsheets in the folder.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;ProcessFile will first set a reference to the currently open workbook (the one with the values we want to search the other workbooks for). The values are present in column A, starting in cell A2. Then the procedure will open the specified workbook (the first one in the array) and use the Range.Find Method against each value in the column, to see if the workbook contains any of the values we need to find. If the given value in column A is found in the newly opened workbook, we copy the values in columns A through L in the same row as the found value into the original workbook, right next to the search value. Sort of like a VLOOKUP on steroids.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;At the end, we print the filename where the value was found, in case there are a lot of workbooks and we need to know later where specifically the value was located. We don't want to have to then go manually through each workbook!</p>
<div class="codecolorer-container vb " style="overflow:auto;white-space:nowrap;width:600px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br /></div></td><td><div class="vb codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">Sub</span> ProcessFile(fileName <span class="kw1">As</span> <span class="kw1">String</span>)<br />
<br />
<span class="kw1">Dim</span> folder <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> rng <span class="kw1">As</span> Excel.Range<br />
<span class="kw1">Dim</span> cell <span class="kw1">As</span> Excel.Range<br />
<span class="kw1">Dim</span> wkbk <span class="kw1">As</span> Excel.Workbook<br />
<span class="kw1">Dim</span> wksht <span class="kw1">As</span> Excel.Worksheet<br />
<span class="kw1">Dim</span> currentWkbk <span class="kw1">As</span> Excel.Workbook<br />
<span class="kw1">Dim</span> currentWksht <span class="kw1">As</span> Excel.Worksheet<br />
<span class="kw1">Dim</span> currentRange <span class="kw1">As</span> Excel.Range<br />
&nbsp;<br />
<span class="kw1">Set</span> wkbk = ActiveWorkbook<br />
<span class="kw1">Set</span> wksht = wkbk.Sheets(&quot;My first sheet name&quot;)<br />
<span class="kw1">Set</span> rng = wksht.Range(wksht.Range(&quot;A2&quot;), wksht.Range(&quot;A&quot; &amp; Rows.Count).<span class="kw1">End</span>(xlUp))<br />
&nbsp;<br />
folder &nbsp;= Environ(&quot;userprofile&quot;) &amp; &quot;\Desktop\Forms\&quot;<br />
<br />
<span class="co1">' open workbook<br />
</span><span class="kw1">Set</span> currentWkbk = Workbooks.<span class="kw1">Open</span>(folder &amp; fileName)<br />
<span class="kw1">Set</span> currentWksht = currentWkbk.Sheets(1)<br />
<span class="kw1">Set</span> currentRange = currentWksht.UsedRange<br />
&nbsp;<br />
<span class="kw1">Dim</span> foundRange <span class="kw1">As</span> Excel.Range<br />
<span class="kw1">For</span> <span class="kw1">Each</span> cell <span class="kw1">In</span> rng<br />
&nbsp;<br />
<span class="kw1">If</span> cell.Offset(0, 1).Value = &quot;&quot; <span class="kw1">Then</span> <span class="co1">' only check if previous info wasn't found<br />
</span> <br />
<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">Set</span> foundRange = currentRange.Find(cell.Value)<br />
&nbsp; <span class="kw1">If</span> <span class="kw1">Not</span> foundRange <span class="kw1">Is</span> <span class="kw1">Nothing</span> <span class="kw1">Then</span> &nbsp;<span class="co1">' range found in this file<br />
</span> &nbsp; &nbsp;<span class="kw1">Set</span> foundRange = currentWksht.Range(currentWksht.Range(&quot;A&quot; &amp; foundRange.Row), currentWksht.Range(&quot;L&quot; &amp; foundRange.Row))<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; foundRange.Copy cell.Offset(0, 1)<br />
&nbsp; &nbsp; cell.Offset(0, 13).Value = fileName<br />
&nbsp; &nbsp; cell.EntireRow.AutoFit<br />
&nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp;<br />
<span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> 0<br />
&nbsp;<br />
<span class="kw1">End</span> <span class="kw1">If</span><br />
&nbsp;<br />
<span class="kw1">Next</span> cell<br />
&nbsp;<br />
currentWkbk.<span class="kw1">Close</span> <span class="kw1">False</span><br />
<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div></td></tr></tbody></table></div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Right after the For loop starts, we check to see if anything already exists in column B (the place where we are writing information when the value is found). If so, that means the value was already found and we can skip to the next one. This assumes that there is nothing already in column B and that each value in column A exists in only one (at most) of the other workbooks. Both of which are true in this case.</p>
<p><br /><br /><br />
This post is from : <a href="http://www.codeforexcelandoutlook.com/blog/">Code For Excel And Outlook Blog</a>. Copyright &copy; Code For Excel And Outlook.
<br /><br />
<a href="http://www.exceluser.com/cmd.asp?af=928709">Do you need plug-and-play Excel Dashboards?</a></p>
<p><a href="http://www.codeforexcelandoutlook.com/blog/2009/07/list-matching-files-in-a-folder-part-two/">List matching files in a folder, part two</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?a=hoHO8fY7yao:EPwaJ2gQvGI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?i=hoHO8fY7yao:EPwaJ2gQvGI:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codeforexcelandoutlook/kylx/~4/hoHO8fY7yao" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codeforexcelandoutlook.com/blog/2009/07/list-matching-files-in-a-folder-part-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codeforexcelandoutlook.com/blog/2009/07/list-matching-files-in-a-folder-part-two/</feedburner:origLink></item>
		<item>
		<title>List matching files in a directory</title>
		<link>http://feedproxy.google.com/~r/codeforexcelandoutlook/kylx/~3/3JeEtIP0Y2E/</link>
		<comments>http://www.codeforexcelandoutlook.com/blog/2009/06/list-matching-files-in-a-directory/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 16:34:13 +0000</pubDate>
		<dc:creator>JP</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[GetFilesList]]></category>
		<category><![CDATA[GetFileType]]></category>
		<category><![CDATA[InStrRev]]></category>
		<category><![CDATA[ReDim Preserve]]></category>

		<guid isPermaLink="false">http://www.codeforexcelandoutlook.com/blog/?p=646</guid>
		<description>&amp;#160;&amp;#160;&amp;#160;&amp;#160;In List matching folders in a directory, I posted a method for creating a list of matching folders in a specified directory.
&amp;#160;&amp;#160;&amp;#160;&amp;#160;Here is a method to list the files in a directory that match a specific file extension. This would be useful when you want to perform some operation on all files of a certain [...]&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
This post is from : &lt;a href="http://www.codeforexcelandoutlook.com/blog/"&gt;Code For Excel And Outlook Blog&lt;/a&gt;. Copyright &amp;copy; Code For Excel And Outlook.
&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://www.exceluser.com/cmd.asp?af=928709"&gt;Do you need plug-and-play Excel Dashboards?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.codeforexcelandoutlook.com/blog/2009/06/list-matching-files-in-a-directory/"&gt;List matching files in a directory&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>&nbsp;&nbsp;&nbsp;&nbsp;In <a href="http://www.codeforexcelandoutlook.com/blog/2009/03/list-matching-folders-in-a-directory/">List matching folders in a directory</a>, I posted a method for creating a list of matching folders in a specified directory.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Here is a method to list the <em>files</em> in a directory that match a specific file extension. This would be useful when you want to perform some operation on all files of a certain type in a folder (move, copy, open, delete, etc).</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;First I'll post the method with a small sample, and in the next post I'll use it in a real application that opens every Excel file in a folder and performs some calculation.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;The following function, titled GetFilesList, returns a string array of filenames in the folder variable <strong>folder</strong> that have the file extension specified in <strong>fileType</strong>. Notice the parentheses after the type declaration in row 1 is what tells VBA we want it to return an array.</p>
<div class="codecolorer-container vb " style="overflow:auto;white-space:nowrap;width:600px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="vb codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">Function</span> GetFilesList(<span class="kw1">ByVal</span> folder <span class="kw1">As</span> <span class="kw1">String</span>, <span class="kw1">ByVal</span> fileType <span class="kw1">As</span> <span class="kw1">String</span>) <span class="kw1">As</span> <span class="kw1">String</span>()<br />
<span class="co1">' build list of files in a folder folder<br />
</span><span class="kw1">Dim</span> fileslist() <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> i <span class="kw1">As</span> <span class="kw1">Long</span><br />
<span class="kw1">Dim</span> currentWorkbook <span class="kw1">As</span> <span class="kw1">String</span><br />
<br />
currentWorkbook = Dir(folder)<br />
<br />
<span class="kw1">Do</span> <span class="kw1">While</span> Len(currentWorkbook) &gt; 0<br />
&nbsp; <span class="kw1">If</span> UCase$(GetFileType(currentWorkbook)) = &quot;.&quot; &amp; UCase$(fileType) <span class="kw1">Then</span><br />
&nbsp; &nbsp; <span class="kw1">ReDim</span> <span class="kw1">Preserve</span> fileslist(i)<br />
&nbsp; &nbsp; fileslist(i) = currentWorkbook<br />
&nbsp; &nbsp; i = i + 1<br />
&nbsp; <span class="kw1">End</span> <span class="kw1">If</span><br />
<br />
&nbsp; currentWorkbook = Dir<br />
<span class="kw1">Loop</span><br />
GetFilesList = fileslist<br />
<br />
<span class="kw1">End</span> <span class="kw1">Function</span><br />
<br />
<span class="kw1">Function</span> GetFileType(<span class="kw1">ByVal</span> fileName <span class="kw1">As</span> <span class="kw1">String</span>) <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="co1">' get file extension<br />
</span><span class="co1">' assumes there are no periods in filename<br />
</span><span class="co1">' (other than the one between the filename and extension)<br />
</span><br />
GetFileType = Mid$(fileName, InStrRev(fileName, &quot;.&quot;), Len(fileName))<br />
<br />
<span class="kw1">End</span> <span class="kw1">Function</span></div></td></tr></tbody></table></div>
<h2>Usage:</h2>
<div class="codecolorer-container vb " style="overflow:auto;white-space:nowrap;width:600px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br /></div></td><td><div class="vb codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">Sub</span> TestFileListGet()<br />
<span class="kw1">Dim</span> str() <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> i <span class="kw1">As</span> <span class="kw1">Long</span><br />
<span class="kw1">Dim</span> dummyString <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> folder <span class="kw1">As</span> <span class="kw1">String</span><br />
<span class="kw1">Dim</span> extension <span class="kw1">As</span> <span class="kw1">String</span><br />
<br />
folder = Environ(&quot;userprofile&quot;) &amp; &quot;\Desktop\My Files\&quot;<br />
extension = &quot;xls&quot;<br />
<br />
str = GetFilesList(folder, extension)<br />
<br />
<span class="co1">' check if array is empty (i.e. no files matching extension exist in given folder)<br />
</span><span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">Resume</span> <span class="kw1">Next</span><br />
<br />
dummyString = str(0)<br />
<span class="kw1">If</span> Err &lt;&gt; 0 <span class="kw1">Then</span><br />
&nbsp; MsgBox &quot;No Files found <span class="kw1">with</span> &quot; &amp; extension &amp; &quot; extension <span class="kw1">in</span> &quot; &amp; vbCrLf &amp; folder, vbExclamation<br />
&nbsp; <span class="kw1">Exit</span> <span class="kw1">Sub</span><br />
<span class="kw1">End</span> <span class="kw1">If</span><br />
<br />
<span class="kw1">On</span> <span class="kw1">Error</span> <span class="kw1">GoTo</span> 0<br />
<br />
<span class="co1">' str contains array of matching filenames from given folder, <br />
</span><span class="co1">' do whatever you want with it<br />
</span><span class="kw1">For</span> i = <span class="kw1">LBound</span>(str) <span class="kw1">To</span> <span class="kw1">UBound</span>(str)<br />
&nbsp; Debug.<span class="kw1">Print</span> str(i)<br />
<span class="kw1">Next</span> i<br />
<br />
MsgBox &quot;Found &quot; &amp; <span class="kw1">UBound</span>(str) + 1 &amp; &quot; file(s) <span class="kw1">with</span> &quot; &amp; extension &amp; _<br />
&nbsp; &quot; extension <span class="kw1">in</span> folder:&quot; &amp; vbCrLf &amp; folder, vbInformation<br />
<br />
<span class="kw1">End</span> <span class="kw1">Sub</span></div></td></tr></tbody></table></div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;If you want to limit the filetypes that a user can browse for, use an enumerated section like this:</p>
<div class="codecolorer-container vb " style="overflow:auto;white-space:nowrap;width:600px"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="vb codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">Enum</span> MyType <span class="kw1">As</span> FileToOpen<br />
xls<br />
ppt<br />
doc<br />
mdb<br />
<span class="kw1">End</span> <span class="kw1">Enum</span></div></td></tr></tbody></table></div>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Then change the first line of GetFilesList to</p>
<p><strong>Function GetFilesList(ByVal folder As String, ByVal fileType As FileToOpen) As String()</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;You would also need to convert the constant back to a string using Select Case or If statements, for comparison purposes, but now the function has custom Intellisense (or is it Auto List Members?) which limits selection to only Excel, PowerPoint, Word and Access documents. </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;A custom function called GetFileType, which I used in a previous post, returns the file extension for a given file. It includes the period "." as well, so the IF statement adds the period to the matching file extension to see if there's a match. ReDim Preserve is used because we don't know how many of a given file type will be in the folder. There can be zero, one, or two hundred, and the code doesn't have to be edited.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;To check if the array is empty (i.e. there were no matching files in the folder), simply try to assign the first value to a string. An error is thrown if there is no value. After the "On Error GoTo 0&#8243; in the sample procedure, you can do anything you like with the array. In my sample, I printed the members of the array to the Immediate window, then used the UBound property to print a count of files found.</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;Next post we'll see a real example of this code in action.</p>
<p><br /><br /><br />
This post is from : <a href="http://www.codeforexcelandoutlook.com/blog/">Code For Excel And Outlook Blog</a>. Copyright &copy; Code For Excel And Outlook.
<br /><br />
<a href="http://www.exceluser.com/cmd.asp?af=928709">Do you need plug-and-play Excel Dashboards?</a></p>
<p><a href="http://www.codeforexcelandoutlook.com/blog/2009/06/list-matching-files-in-a-directory/">List matching files in a directory</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?a=3JeEtIP0Y2E:QU3rX21ln_Q:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/codeforexcelandoutlook/kylx?i=3JeEtIP0Y2E:QU3rX21ln_Q:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/codeforexcelandoutlook/kylx/~4/3JeEtIP0Y2E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.codeforexcelandoutlook.com/blog/2009/06/list-matching-files-in-a-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.codeforexcelandoutlook.com/blog/2009/06/list-matching-files-in-a-directory/</feedburner:origLink></item>
	</channel>
</rss>
