<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-12670472</id><updated>2009-12-06T18:17:10.929+10:30</updated><title type='text'>Excel Thoughts</title><subtitle type='html'>Random Stuff about Excel, Visual Studio and C#.</subtitle><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://excelthoughts.com/atom.xml'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-12670472.post-8498574901363399626</id><published>2009-09-21T13:11:00.000+09:30</published><updated>2009-09-21T13:11:02.550+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='backup'/><title type='text'>Using Dropbox to Sync files online and across different computers</title><content type='html'>I recently lost a couple of hard drives in a storm and lost a lot of data. So, I went looking for an easy online backup solution. I looked at a few options and started using Dropbox recently.&lt;br /&gt;&lt;br /&gt;From Dropbox's website:&lt;br /&gt;&lt;ul class="clearfix"&gt;&lt;li&gt;You can sync up to 100GB of your files online and across different computers.&amp;nbsp;&lt;/li&gt;&lt;li&gt;Sync files of any size or type&lt;/li&gt;&lt;li&gt;Share large files and photos easily&lt;/li&gt;&lt;li&gt;Automatic online backup&lt;/li&gt;&lt;li&gt;Track and undo changes to files&lt;/li&gt;&lt;/ul&gt;They give you 2GB storage for free so why not give it a try?&lt;br /&gt;&lt;br /&gt;Click the Dropbox link on the right hand side of this blog to go straight to their site.&lt;br /&gt;&lt;div id="ifyou" style="text-align: left;"&gt;   &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-8498574901363399626?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/8498574901363399626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=8498574901363399626' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/8498574901363399626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/8498574901363399626'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2009/09/using-dropbox-to-sync-files-online-and.html' title='Using Dropbox to Sync files online and across different computers'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-5341624368742335324</id><published>2008-07-10T09:32:00.004+09:30</published><updated>2008-07-10T09:58:50.063+09:30</updated><title type='text'>C# version of VB6/VBA's Val function</title><content type='html'>Here is some code to emulate VB6/VBA's Val function in C#. I found the original &lt;a href="http://www.dreamincode.net/code/snippet1821.htm"&gt;http://www.dreamincode.net/code/snippet1821.htm&lt;/a&gt; but it needed some changes to work correctly.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td nowrap="nowrap"&gt;&lt;div style=""&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;RegularExpressions;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;using&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;namespace&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;ValinCS&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Program&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;void&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Main&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;string&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;args&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Console&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;AAA234&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Console&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;1234asdv&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Console&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt; &lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt; &lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;345&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Console&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;1.2345f&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Console&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt; &lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt; &lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Console&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Console&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;12&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Val&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;string&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;value&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;string&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;returnVal&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;string&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Empty;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;tryInt&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;0&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;^&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;specifies&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;that&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;the&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;match&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;has&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;to&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;start&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;at&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;the&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;start&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;of&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;the&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;string&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;Trim()&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;trims&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;both&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;ends&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;of&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;the&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;before&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;matching&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;MatchCollection&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;collection&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Regex&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Matches&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;value&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Trim&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;^\\d+&lt;/span&gt;&lt;span style="color: rgb(70, 130, 180);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;Match&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;match&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;collection&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;returnVal&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;=&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;match&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;//&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;attempt&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;conversion&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;to&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;int&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 139);"&gt;int&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;TryParse&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;returnVal,&lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;out&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;tryInt&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;b&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt;&lt;/b&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;tryInt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-5341624368742335324?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/5341624368742335324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=5341624368742335324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/5341624368742335324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/5341624368742335324'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2008/07/c-version-of-vb6vbas-val-function.html' title='C# version of VB6/VBA&apos;s Val function'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-4360423913632192225</id><published>2008-07-02T21:58:00.004+09:30</published><updated>2008-07-02T22:06:55.503+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Serialization'/><category scheme='http://www.blogger.com/atom/ns#' term='Cloning'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Cloning using Serialization</title><content type='html'>I found some great C# code the other day which allows deep copying of objects, rather than shallow copies which object.Clone() does. Saved heaps of time mucking around with the ICloneable interface, and basically rewriting heaps of code.&lt;br /&gt;&lt;br /&gt;You need to decorate the class(es) that you want to clone with the [Serializable] attribute. If you are trying to clone a object of a type which has members of some other class, those classes need to be serializable too.&lt;br /&gt;&lt;br /&gt;public static object Clone(object obj)&lt;br /&gt;    {&lt;br /&gt;        MemoryStream ms = new MemoryStream();&lt;br /&gt;        BinaryFormatter bf = new BinaryFormatter();&lt;br /&gt;        bf.Serialize(ms, obj);&lt;br /&gt;        ms.Flush();&lt;br /&gt;        ms.Seek(0, SeekOrigin.Begin);&lt;br /&gt;        return bf.Deserialize(ms);&lt;br /&gt;    }&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-4360423913632192225?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/4360423913632192225/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=4360423913632192225' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/4360423913632192225'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/4360423913632192225'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2008/07/cloning-using-serialization.html' title='Cloning using Serialization'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-7385549364808235223</id><published>2008-07-02T15:33:00.006+09:30</published><updated>2008-07-04T08:52:10.923+09:30</updated><title type='text'>Ebay International Search Gadget rewritten</title><content type='html'>For any of you that use the Ebay international search gadget on the right hand side of the blog, I have just rewritten it as it was not working anymore.&lt;br /&gt;&lt;br /&gt;I am have also added an Amazon international search gadget.&lt;br /&gt;&lt;br /&gt;Use them directly from this site or add them to your iGoogle page. Note that the international functionadoes not work if you use the gadgets directly from this site. It only links to the respective US sites.  You need to add it to a your iGoogle page to get the full functionality.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-7385549364808235223?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/7385549364808235223/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=7385549364808235223' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/7385549364808235223'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/7385549364808235223'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2008/07/ebay-international-search-gadget.html' title='Ebay International Search Gadget rewritten'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-3608696161584280870</id><published>2008-05-06T13:14:00.004+09:30</published><updated>2008-05-06T13:29:39.465+09:30</updated><title type='text'>Creating Excel/Office 2007 Addins  in Visual Studio 2008</title><content type='html'>A month or 2 ago I went to the Heroes launch of VS 2008 in Adelaide.  There are some exciting things happening in VS2008, especially with the Shared Addin in VS2008.  Previously, you needed to go through the mess of creating a Shim, and manually creating XML to write to a ribbon.  Now, they have made it simple.  There is a Ribbon control to add which creates all the XML in the background, and all the shimming stuff happens automatically.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Create a New Project&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.excelthoughts.com/uploaded_images/Excel2007-717100.jpg"&gt;&lt;img style="cursor: pointer;" src="http://www.excelthoughts.com/uploaded_images/Excel2007-717096.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Adding a Ribbon Control&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.excelthoughts.com/uploaded_images/Excel2007-2-747260.jpg"&gt;&lt;img style="cursor: pointer;" src="http://www.excelthoughts.com/uploaded_images/Excel2007-2-747253.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Adding Controls from the Toolbox to the Ribbon&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.excelthoughts.com/uploaded_images/Excel2007-3-747285.jpg"&gt;&lt;img style="cursor: pointer;" src="http://www.excelthoughts.com/uploaded_images/Excel2007-3-747282.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Finally!!! It is easy.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-3608696161584280870?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/3608696161584280870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=3608696161584280870' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/3608696161584280870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/3608696161584280870'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2008/05/creating-exceloffice-2007-addins-in.html' title='Creating Excel/Office 2007 Addins  in Visual Studio 2008'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-7914115163185519544</id><published>2007-09-07T14:29:00.000+09:30</published><updated>2007-09-07T14:32:19.385+09:30</updated><title type='text'>Apologies...</title><content type='html'>Apologies to all who visit here of late.  The server I use has been taken offline, and I am in the process of moving all files to a new server.  All images and downloadable files are currently missing.&lt;br /&gt;&lt;br /&gt;And when I have time, I will share some Excel/C# porting experiences.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-7914115163185519544?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/7914115163185519544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=7914115163185519544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/7914115163185519544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/7914115163185519544'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2007/09/apologies.html' title='Apologies...'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-2792283022045338064</id><published>2007-01-09T10:30:00.000+10:30</published><updated>2007-01-09T13:47:48.991+10:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='CommandBars'/><title type='text'>Using Images in CommandBarButtons</title><content type='html'>A reader asked me whether he could add any image to a Word or Excel toolbar button without using any VBA. I have put together a couple of screenshots from Word, but they are virtually identical in Excel (pre Office 2007). Office 2007 has a Ribbon instead, so that post will come later.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Image 1&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.excelthoughts.com/uploaded_images/Customise-766684.jpg"&gt;&lt;img style="CURSOR: hand" alt="" src="http://www.excelthoughts.com/uploaded_images/Customise-762432.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;If you right click on the Toolbar area in word or Excel, you can customise (forgive the Australian spelling with an 's'!) the way the Toolbar looks. (see Image 1) . Click "Customize" at the bottom of this context menu.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Image 2&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.excelthoughts.com/uploaded_images/Customise-Word2-760946.jpg"&gt;&lt;img style="CURSOR: hand" alt="" src="http://www.excelthoughts.com/uploaded_images/Customise-Word2-756803.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This will display the "Customize" menu (Image 2). To add your own button, select the Commands tab, and select "Macros" from the list. If there is nothing in the right window (Normal.NewMacros.Macro1 is in the right window in this example), you need to record a macro using the Macro Recorder.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Image 3&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.excelthoughts.com/uploaded_images/Customise-Word3-704928.jpg"&gt;&lt;img style="CURSOR: hand" alt="" src="http://www.excelthoughts.com/uploaded_images/Customise-Word3-798780.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, drag this macro from the right window onto the Toolbar where you want it. The I Beam cursor is displayed to indicate where the new button will be displayed. (Image 3)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Image 4&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.excelthoughts.com/uploaded_images/Customise-Word4-755384.jpg"&gt;&lt;img style="CURSOR: hand" alt="" src="http://www.excelthoughts.com/uploaded_images/Customise-Word4-752219.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;When you let go of the mouse the button is displayed (Image 4)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Image 5&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://www.excelthoughts.com/uploaded_images/Customise-Word6-786361.jpg"&gt;&lt;img style="CURSOR: hand" alt="" src="http://www.excelthoughts.com/uploaded_images/Customise-Word6-781202.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;To rename the Button, change the text in the Name section. To show your image, copy an image from somewhere on your computer to the clipboard, and click "Paste Button Image". Click Image and Text to display your image. (Image 5)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-2792283022045338064?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/2792283022045338064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=2792283022045338064' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/2792283022045338064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/2792283022045338064'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2007/01/using-images-in-commandbarbuttons.html' title='Using Images in CommandBarButtons'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-1262915689654959455</id><published>2006-12-30T08:59:00.000+10:30</published><updated>2007-01-09T15:47:57.287+10:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Names'/><title type='text'>Name Manager in Excel 2007</title><content type='html'>I thought I would do a series on some of the features in &lt;span style="FONT-WEIGHT: bold"&gt;Excel 2007.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of the annoying things in old Excel was the maintenance of Names. Excel 2007 has made it a lot nicer with the &lt;span style="FONT-WEIGHT: bold"&gt;Name Manager&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Here is a part of the Formulas tab with the Name Manager highlighted.&lt;br /&gt;&lt;br /&gt;&lt;img style="WIDTH: 414px; HEIGHT: 84px" height="96" src="http://www.excelthoughts.com/images/FormulasTab.jpg" width="433" /&gt;&lt;br /&gt;&lt;br /&gt;Click this and the following is displayed. You can see clearly which name is a Workbook scope and which is a Worksheet scope.&lt;br /&gt;&lt;br /&gt;&lt;img height="320" src="http://www.excelthoughts.com/images/NameManager.jpg" width="414" /&gt;&lt;br /&gt;&lt;br /&gt;Click New to add a new name... In the Scope section, you have the choice of Workbook or the individual sheets in the Workbook. Easy!&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.excelthoughts.com/images/NameManager2.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;Also you can use &lt;span style="FONT-WEIGHT: bold"&gt;Name a Range &lt;/span&gt;to highlight a range and then apply a name to it or &lt;span style="FONT-WEIGHT: bold"&gt;Apply Names&lt;/span&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-size:100%;"&gt; to apply an existing name to a highlighted range&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.excelthoughts.com/images/ApplyNames.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;If you wish to add a formula with a name in it, choose&lt;/span&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Use In Formula.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.excelthoughts.com/images/UseInFormulas.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:0;"&gt;&lt;span style="font-size:100%;"&gt;One last thing possible is for Excel to automatically create names based on the content on the cells using&lt;/span&gt; &lt;/span&gt;&lt;span style="FONT-WEIGHT: bold"&gt;&lt;span style="FONT-WEIGHT: bold"&gt;Create From Selection&lt;/span&gt;. &lt;/span&gt;Highlight a desired section, and Excel gives you options for which part of the selection you would like the Name to be created from. In this case, Excel created 3 Workbook scope names for me, Alpha, Bravo and Charlie.&lt;span style="FONT-WEIGHT: bold"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.excelthoughts.com/images/CreateFromSelection.jpg" /&gt; &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-1262915689654959455?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/1262915689654959455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=1262915689654959455' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/1262915689654959455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/1262915689654959455'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2006/12/name-manager-in-excel-2007.html' title='Name Manager in Excel 2007'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-115084882468415492</id><published>2006-06-21T09:33:00.000+09:30</published><updated>2006-08-31T14:37:24.640+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Shapes'/><category scheme='http://www.blogger.com/atom/ns#' term='Shared Addin'/><title type='text'>Working with Excel Shapes  from C#</title><content type='html'>In VBA, you can select shapes and control them usingSelection.ShapeRange. Selection morphs to different types depending on what property is called. Go&lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaxl11/html/xlobjShapeRange1_HV05205006.asp"&gt; here&lt;/a&gt; for more information.&lt;br /&gt;&lt;br /&gt;In C#, the Selection(range) object does not have a ShapeRange property. However the DrawingObjects object does have aShapeRange property. So if you want to copy a ShapeRange from one sheet to another, try the following.&lt;br /&gt;&lt;br /&gt;Say you have this VBA code to port to C#:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Set aShape = srcSheet.DrawingObjects.ShapeRange.Group&lt;br /&gt;x = aShape.Left&lt;br /&gt;y = aShape.Top&lt;br /&gt;aShape.Copy&lt;br /&gt;dstSheet.Paste&lt;br /&gt;Selection.Left = x&lt;br /&gt;Selection.Top = y&lt;br /&gt;Selection.ShapeRange.Ungroup&lt;br /&gt;aShape.Ungroup&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This converts to:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;aShape = (Excel.Shape)drawObj.ShapeRange.Group();&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;x = aShape.Left;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;y = aShape.Top;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;aShape.Copy();&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;dstSheet.Paste(Missing, Missing);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;drawObj = (Excel.DrawingObjects)dstSheet.DrawingObjects(Missing);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Excel.ShapeRange shapeRng = (Excel.ShapeRange)drawObj.ShapeRange;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;shapeRng.Left = (float)x;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;shapeRng.Top = (float)y;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;shapeRng.Ungroup();&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;aShape.Ungroup();&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This solution assumes that there was nothing on the destination sheet to begin with. (the line dstSheet.DrawingObjects refers to all the Drawing objects on the sheet)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-115084882468415492?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/115084882468415492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=115084882468415492' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/115084882468415492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/115084882468415492'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2006/06/working-with-excel-shapes-from-c.html' title='Working with Excel Shapes  from C#'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-114922476591063077</id><published>2006-06-02T14:31:00.000+09:30</published><updated>2006-06-02T15:45:44.663+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='RibbonX'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Shared Addin'/><title type='text'>Using RibbonX UI with Office 2007 from C# COM Addin</title><content type='html'>Hi all,&lt;br /&gt;&lt;br /&gt;Yes, I am here still. I have been trying to use the RibbonX control in Office 2007 from a C# COM Addin. There is only one other blog that I have seen that has touched on the subject so far &lt;a href="http://pschmid.net"&gt;http://pschmid.net&lt;/a&gt; , so I look forward to seeing what he has to say in the coming weeks.&lt;br /&gt;&lt;br /&gt;Any other blogs out there covering this subject?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-114922476591063077?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/114922476591063077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=114922476591063077' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/114922476591063077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/114922476591063077'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2006/06/using-ribbonx-ui-with-office-2007-from.html' title='Using RibbonX UI with Office 2007 from C# COM Addin'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-113485885417959166</id><published>2005-12-18T09:00:00.000+10:30</published><updated>2007-01-09T15:31:35.974+10:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='CommandBarButtons'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Shared Addin'/><title type='text'>Garbage Collection of CommandBarButtons</title><content type='html'>I am building an Excel Addin in C#. It starts with creation of a single&lt;br /&gt;commandbutton on the Excel toolbar (call it B1). When clicked this opens&lt;br /&gt;a form with a few Pictureboxes. These pictureboxes can either be clicked&lt;br /&gt;to start some routine or dragged onto the Excel toolbar to become a&lt;br /&gt;commandbutton (call them B2). The commandbutton B2 has a clickhandler&lt;br /&gt;event and has OnAction as . When I click the&lt;br /&gt;pictureboxes on the Form, the form is made invisible. The pictureboxes&lt;br /&gt;on the form fire ok, but after a series of events, the commandbutton&lt;br /&gt;click events do not fire anymore.&lt;br /&gt;&lt;br /&gt;e.g&lt;br /&gt;1. open Excel, click a commandbutton previously dragged onto the Excel&lt;br /&gt;toolbar (B2) - fires ok&lt;br /&gt;2. click commandbutton on toolbar (B1) and click a pictureBox on Form -&lt;br /&gt;fires ok&lt;br /&gt;3. click (B2) - does not fire&lt;br /&gt;4. click (B1) and click a pictureBox - fires ok&lt;br /&gt;&lt;br /&gt;I should note that each time the commandbutton or picbox is clicked the&lt;br /&gt;excel object is obtained from your method given in&lt;br /&gt;&lt;a href="http://blogs.officezealot.com/whitechapel/archive/2005/04/10.aspx"&gt;&lt;span style="font-size:78%;"&gt;http://blogs.officezealot.com/whitechapel/archive/2005/04/10.aspx&lt;/span&gt;&lt;/a&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Andrew`Whitechapel: Second, the behavior you describe for the event handlers sounds exactly&lt;br /&gt;like the classic delegate scoping issue. The object that holds the event&lt;br /&gt;sink (delegate) must be declared at class scope, not at function scope.&lt;br /&gt;If you declare it at function scope it will go out of scope at the end&lt;br /&gt;of the function and become available for garbage collection. It will&lt;br /&gt;then actually be garbage collected at some indeterminate point in the&lt;br /&gt;future.&lt;br /&gt;&lt;br /&gt;So, my advice is to use the Excel.Application object given to you up&lt;br /&gt;front, and cache this at class scope. Then also cache the&lt;br /&gt;CommandBarButton object at class scope.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-113485885417959166?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/113485885417959166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=113485885417959166' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/113485885417959166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/113485885417959166'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/12/garbage-collection-of.html' title='Garbage Collection of CommandBarButtons'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-113485855976101598</id><published>2005-12-18T08:45:00.000+10:30</published><updated>2005-12-18T08:59:19.776+10:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Shared Addin'/><title type='text'>Creating Excel Addin with C# Extensibility</title><content type='html'>Well it has been a long time since my last.  &lt;br /&gt;I have been using C# over the last few months to automate an Excel Addin and have run into every gotcha known to man!&lt;br /&gt;I will be compiling my experiences and hopefully they will be helpful to new Excel/Office Addin programmers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-113485855976101598?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/113485855976101598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=113485855976101598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/113485855976101598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/113485855976101598'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/12/creating-excel-addin-with-c.html' title='Creating Excel Addin with C# Extensibility'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-111990868728533519</id><published>2005-06-28T06:32:00.000+09:30</published><updated>2005-06-28T07:16:31.743+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>Creating Long SQL strings with Arrays</title><content type='html'>If you've ever created an long SQL string for a Pivot Table or some other reason, you will have come across Excel's limitations in this area. For example, you cannot have too many line continuations ( _ ). Also, if you have used the macro recorder while getting External Data through MS Query, there is some limitation there too. It will not actually record all the SQL, but cuts it off half way through. &lt;br /&gt;&lt;br /&gt;The way the recorder works when getting data for a Pivot Table is interesting and I thought I'd use it in my code in a different way. It creates an array of arrays like this: &lt;br /&gt;&lt;br /&gt;&lt;font face=Courier New&gt;&lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt; Macro1()&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;' Macro1 Macro&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;' Macro recorded 28/06/2005 by A&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;With&lt;/SPAN&gt; ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Connection = Array(Array( _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"ODBC;DSN=Xtreme Sample Database 2003;DBQ=C:\Program Files\Microsoft Visual Studio .NET 2003\Crystal Reports\Samples\Database\xtreme." _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;), Array("mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.CommandType = xlCmdSql&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.CommandText = Array( _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"SELECT Employee.`Employee ID`, Employee.`Supervisor ID`, Employee.`Last Name`, Employee.`First Name`, Employee.Position, Employee.`Birth Date`, Employee.`Hire Date`, Employee.`Home Phone`, Employee.Ex" _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;, _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"tension, Employee.Photo, Employee.Notes, Employee.`Reports To`, Employee.Salary, Employee.SSN, Employee.`Emergency Contact First Name`, Employee.`Emergency Contact Last Name`, Employee.`Emergency Cont" _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;, _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"act Relationship`, Employee.`Emergency Contact Phone`" &amp; Chr(13) &amp; "" &amp; Chr(10) &amp; "FROM Employee Employee" _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.CreatePivotTable TableDestination:="[Book1]Sheet1!R3C1", TableName:= _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"PivotTable1", DefaultVersion:=xlPivotTableVersion10&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;With&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'do stuff with pivot tables&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt;&lt;/FONT&gt;&lt;br /&gt;&lt;br /&gt;It's a bit messy so I thought I'd clean it up. I used the array idea by adding bits of the string into the next element of a growing array, and then joining the array using the Join Function (opposite of Split). &lt;br /&gt;&lt;br /&gt;&lt;font face=Courier New&gt;&lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt; Macro1Redo()&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; ssql &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;String&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; sConn &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;String&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'create the array string&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "SELECT Employee.Employee ID, Employee.Supervisor ID, Employee.Last Name,")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "Employee.First Name, Employee.Position, Employee.Birth Date, ")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "Employee.Hire Date,Employee.Home Phone, Employee.Extension,")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "Employee.Photo, Employee.Notes, Employee.Reports To,")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "Employee.Salary, Employee.SSN, Employee.Emergency Contact First Name,")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "Employee.Emergency Contact Last Name, Employee.Emergency Contact Relationship,")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "Employee.Emergency Contact Phone ")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(ssql, "FROM Employee")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'join the strings back together&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ssql = Join(ssql)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(sConn, "ODBC;DSN=Xtreme Sample Database 2003;")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(sConn, "DBQ=C:\Program Files\Microsoft Visual Studio .NET 2003\")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(sConn, "Crystal Reports\Samples\Database\xtreme.mdb;")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; AddToArray(sConn, "DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;")&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'join the strings back together&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;sConn = Join(sConn)&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;With&lt;/SPAN&gt; ActiveWorkbook.PivotCaches.Add(SourceType:=xlExternal)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.Connection = sConn&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.CommandType = xlCmdSql&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.CommandText = ssql&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.CreatePivotTable TableDestination:="[Book1]Sheet1!R3C1", TableName:= _&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;"PivotTable1", DefaultVersion:=xlPivotTableVersion10&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;With&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'do stuff with pivot tables&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt; AddToArray(myArray &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Variant&lt;/SPAN&gt;, arrayElement &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Variant&lt;/SPAN&gt;)&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Not&lt;/SPAN&gt; IsArrayInitialized(myArray) &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;ReDim&lt;/SPAN&gt; myArray(0)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myArray(0) = arrayElement&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Else&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;ReDim&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Preserve&lt;/SPAN&gt; myArray(UBound(myArray) + 1)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myArray(UBound(myArray)) = arrayElement&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-111990868728533519?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/111990868728533519/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=111990868728533519' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111990868728533519'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111990868728533519'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/06/creating-long-sql-strings-with-arrays.html' title='Creating Long SQL strings with Arrays'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-111888228866849585</id><published>2005-06-16T09:52:00.000+09:30</published><updated>2005-06-16T10:08:08.673+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Games'/><title type='text'>Using Randomization in Battleship Game</title><content type='html'>There are a set of challenges at &lt;a href="http://www.xl-logic.com/pages/challenge.html"&gt;http://www.xl-logic.com/pages/challenge.html&lt;/a&gt; and I thought I'd give the Battleship Challenge a go. It involves the use of random numbers to fill a Battleship board without the ships falling off the board or overlapping each other. I used colours to represent the ships. There was an extra challenge to use shapes for the ships. I tried this out, but could not get the vertical ships to line up correctly. The cell.top and .left and shape.top and .left properties seem to be out of sync when you rotate an auto shape by 90 degress. Maybe someone has a solution? You can download the workbook &lt;a href="http://www.excelthoughts.com/files/Battleship.xls" target="_blank"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.excelthoughts.com/images/Game.jpg" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-111888228866849585?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/111888228866849585/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=111888228866849585' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111888228866849585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111888228866849585'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/06/using-randomization-in-battleship-game.html' title='Using Randomization in Battleship Game'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-111827370802640219</id><published>2005-06-09T09:04:00.000+09:30</published><updated>2005-06-11T18:13:08.373+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='References'/><title type='text'>Removing Broken References and Adding VBA References</title><content type='html'>&lt;span style="font-family:arial;"&gt;A user had a question about my &lt;/span&gt;&lt;a href="http://www.excelthoughts.com/2005/06/controlling-outlook-from-excel.html" target="_blank"&gt;&lt;span style="font-family:arial;"&gt;Controlling Outlook From Excel&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; post.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;I have been reading your homepage and I have a problem with my macro. It works&lt;br /&gt;fine when the Microsoft Outlook Object Library is checked as reference.&lt;br /&gt;But my file is to be executed on 67 different PCs and they have not (many of them)&lt;br /&gt;any reference marked to Outlook. And if the reference to outlook is not marked&lt;br /&gt;in advance, then the macro doesn’t run – but displays a compile error.&lt;br /&gt;&lt;br /&gt;I have tried this with both Early and Late Binding.&lt;br /&gt;&lt;br /&gt;Do you know a method where the macro by itself find the outlook version and automatically set the references? &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I had the same problem, as I take a workbook of mine home and there are different versions of Outlook. When I returned to work, there was always a broken reference to Outlook 11 (2003).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;The following code runs fine on my machine but I do not have any broken references at the moment. Note that the Auto_Open routine along with the rest of the code needs to be in a standard module. Auto_Open runs before the Workbook_Open event. Thanks to a comment from &lt;/span&gt;&lt;a href="http://www.vangelder.co.nz/excel" target="_blank"&gt;&lt;span style="font-family:arial;"&gt;Rob van Gelder&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; for the major and minor version code.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:arial;"&gt;Note that there needs to be a reference to “Microsoft Visual Basic for Applications Extensibility 5.3? for this code to work.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:Courier;"&gt;&lt;span style="color:#00007f;"&gt;Sub&lt;/span&gt; Auto_Open()&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Call&lt;/span&gt; RemoveOutlookReferences&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Call&lt;/span&gt; LoadOutlookReferences&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;End&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Sub&lt;/span&gt; LoadOutlookReferences()&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;'load Outlook object library&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;On&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Error&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Resume&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;'When using AddFromGUID, you can use zero for the major&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;'and minor versions to pick the latest.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;'adding VBE object library:&lt;/span&gt;&lt;br /&gt;ActiveWorkbook.VBProject.References.AddFromGuid _&lt;br /&gt;"{0002E157-0000-0000-C000-000000000046}", 0, 0&lt;br /&gt;&lt;span style="color:#007f00;"&gt;'Adding outlook object library:&lt;/span&gt;&lt;br /&gt;Application.VBE.ActiveVBProject.References _&lt;br /&gt;.AddFromGuid "{00062FFF-0000-0000-C000-000000000046}", 0, 0&lt;br /&gt;&lt;span style="color:#00007f;"&gt;On&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Error&lt;/span&gt; &lt;span style="color:#00007f;"&gt;GoTo&lt;/span&gt; 0&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;End&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Function&lt;/span&gt; ReferenceIsBroken(sRef &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; &lt;span style="color:#00007f;"&gt;String&lt;/span&gt;) &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Boolean&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Dim&lt;/span&gt; vbProj &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; VBProject &lt;span style="color:#007f00;"&gt;' This refers to your VBA project.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Dim&lt;/span&gt; chkRef &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; Reference &lt;span style="color:#007f00;"&gt;' A reference.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;' Refer to the VBA project.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Set&lt;/span&gt; vbProj = ThisWorkbook.VBProject&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;' Check through the selected references in the References dialog box.&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;For&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Each&lt;/span&gt; chkRef &lt;span style="color:#00007f;"&gt;In&lt;/span&gt; vbProj.References&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;If&lt;/span&gt; sRef = chkRef.Name And chkRef.IsBroken &lt;span style="color:#00007f;"&gt;Then&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;'if the ref matches the found ref and it is broken&lt;/span&gt;&lt;br /&gt;ReferenceIsBroken = &lt;span style="color:#00007f;"&gt;True&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Exit&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;End&lt;/span&gt; &lt;span style="color:#00007f;"&gt;If&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Next&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ReferenceIsBroken = &lt;span style="color:#00007f;"&gt;False&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;End&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Sub&lt;/span&gt; RemoveOutlookReferences()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Dim&lt;/span&gt; liCnt &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Integer&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Dim&lt;/span&gt; sRef &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; &lt;span style="color:#00007f;"&gt;String&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Dim&lt;/span&gt; count&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Dim&lt;/span&gt; sThisVBEName &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; &lt;span style="color:#00007f;"&gt;String&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Const&lt;/span&gt; OUTLOOK_REF &lt;span style="color:#00007f;"&gt;As&lt;/span&gt; &lt;span style="color:#00007f;"&gt;String&lt;/span&gt; = "OUTLOO"&lt;br /&gt;&lt;br /&gt;sThisVBEName = ThisWorkbook.VBProject.Name&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#007f00;"&gt;'' Remove references to Outlook if they are there and are broken&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;For&lt;/span&gt; liCnt = Application.VBE.VBProjects.Item(sThisVBEName).References.count &lt;span style="color:#00007f;"&gt;To&lt;/span&gt; 1 &lt;span style="color:#00007f;"&gt;Step&lt;/span&gt; -1&lt;br /&gt;sRef = UCase(Left(Application.VBE.VBProjects.Item(sThisVBEName).References.Item(liCnt).Name, 6))&lt;br /&gt;&lt;br /&gt;Debug.Print sRef&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;If&lt;/span&gt; sRef = OUTLOOK_REF And ReferenceIsBroken(sRef) &lt;span style="color:#00007f;"&gt;Then&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Application.VBE.VBProjects.Item(sThisVBEName).References.Remove Application.VBE.VBProjects.Item(sThisVBEName).References.Item(liCnt)&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;End&lt;/span&gt; &lt;span style="color:#00007f;"&gt;If&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;Next&lt;/span&gt; liCnt&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#00007f;"&gt;End&lt;/span&gt; &lt;span style="color:#00007f;"&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-111827370802640219?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/111827370802640219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=111827370802640219' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111827370802640219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111827370802640219'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/06/removing-broken-references-and-adding.html' title='Removing Broken References and Adding VBA References'/><author><name>Andrew Roberts</name><uri>http://www.blogger.com/profile/08393356026954382118</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='09819448534629419795'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-111819237321322908</id><published>2005-06-08T09:59:00.000+09:30</published><updated>2005-06-08T10:29:33.216+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Icons'/><title type='text'>Updated FaceIDs program</title><content type='html'>&lt;span style="font-family:arial;"&gt;Some time ago, John Walkenbach at JWalk came up with an addin to show FaceIDs and their Control IDs.&lt;br /&gt;&lt;br /&gt;Check out &lt;/span&gt;&lt;a href="http://www.j-walk.com/ss/excel/tips/tip67.htm" target="_blank"&gt;&lt;span style="font-family:arial;"&gt;http://www.j-walk.com/ss/excel/tips/tip67.htm&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; to see his version.&lt;br /&gt;&lt;br /&gt;Incidentally, he said that I can do whatever I like with it because his &lt;/span&gt;&lt;a href="http://www.j-walk.com/ss/pup/pup6/index.htm" target="_blank"&gt;&lt;span style="font-family:arial;"&gt;PUP add-in&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; has a MUCH better tool for identifying FaceIDs.&lt;br /&gt;&lt;br /&gt;I have been using the original FaceID xla a fair bit in my work and have adapted it slightly. The reason I changed it is because most of the time, the FaceIDs are invalid for use on the menu, and I wanted to be able to see this when browsing the UserForm. Whenever the FaceID is invalid, the FaceID number will be black instead of the normal yellow. Download my version &lt;/span&gt;&lt;a href="http://excelthoughts.com/files/faceids.exe" target="_blank"&gt;&lt;span style="font-family:arial;"&gt;here&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;a href="mailto:andrew@excelthoughts.com"&gt;&lt;span style="font-family:arial;"&gt;Email me&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family:arial;"&gt; if you want a version for Excel 2003. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Check out the JWalk's site for install instructions.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-111819237321322908?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/111819237321322908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=111819237321322908' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111819237321322908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111819237321322908'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/06/updated-faceids-program.html' title='Updated FaceIDs program'/><author><name>Andrew Roberts</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-111803969558376621</id><published>2005-06-06T15:03:00.000+09:30</published><updated>2005-06-06T16:20:45.970+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='APIs'/><category scheme='http://www.blogger.com/atom/ns#' term='Automation'/><title type='text'>Automatic Mouse Movement on UserForms</title><content type='html'>&lt;span style="font-family:arial;"&gt;I have been&lt;/span&gt; using an Excel addin which I had need to automate some&lt;br /&gt;procedures overnight. There are a number a userforms which&lt;br /&gt;have certain commandbuttons to click. Unfortunately, you cannot&lt;br /&gt;access the Command Button click event from external code.&lt;br /&gt;&lt;br /&gt;So I searched far and wide for a solution. I found the MouseMove API&lt;br /&gt;routine and adapted it for VBA Userforms.&lt;br /&gt;&lt;br /&gt;The principle is that you obtain and enter the dimensions of the UserForm&lt;br /&gt;and Control that you want to access, and then the mouse moves&lt;br /&gt;by itself to that location after a predetermined delay.&lt;br /&gt;&lt;br /&gt;Here is a &lt;a href="http://www.excelthoughts.com/docs/MouseMove.xls"&gt;sample&lt;/a&gt; file to download if you wish to try it. Open the workbook, click the Start command button and a UserForm is shown. The mouse will click the command UserForm's button automatically.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-111803969558376621?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/111803969558376621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=111803969558376621' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111803969558376621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111803969558376621'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/06/automatic-mouse-movement-on-userforms.html' title='Automatic Mouse Movement on UserForms'/><author><name>Andrew Roberts</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-111769522099428326</id><published>2005-06-02T16:03:00.000+09:30</published><updated>2005-06-08T15:50:56.733+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Outlook'/><title type='text'>Controlling Outlook from Excel</title><content type='html'>&lt;span style="font-family:arial;"&gt;I needed to be able to email a sheet or a workbook to Outlook after &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;running some code on the sheet to strip the code, formulas etc. The &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;built in Excel Send To dialog just send the workbook or sheet as is. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I have attached the code for controlling outlook. all you need to do is &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;manipulate your&lt;/span&gt; &lt;span style="font-family:arial;"&gt;workbook and set the wbname variable to be your &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Workbook name. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To send one sheet only, copy your sheet to another &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;workbook first &lt;/span&gt;&lt;span style="font-family:arial;"&gt;and&lt;/span&gt;&lt;span style="font-family:arial;"&gt; delete the default sheets.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color:black;"&gt;&lt;pre&gt;&lt;br /&gt;&lt;hr style="verticalAlign: top;font-size:78%;" &gt;&lt;br /&gt;&lt;span style="color:#0000a0;"&gt;Sub&lt;/span&gt; MailToOutlook()&lt;br /&gt;&lt;span style="color:#008000;"&gt;'notes:&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;'You need a reference to the Outlook library by&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;'going to Tools &amp;gt; References and finding&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;'the outlook library&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;'if you open this with a computer with outlook 2003&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;', the reference will change&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;'to Outlook 11 library, compared to Outlook 2000&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;'which will refer an outlook 9 library&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;wbname = ThisWorkbook.FullName&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#0000a0;"&gt;Dim&lt;/span&gt; objol &lt;span style="color:#0000a0;"&gt;As&lt;/span&gt; New Outlook.Application&lt;br /&gt;&lt;span style="color:#0000a0;"&gt;Dim&lt;/span&gt; objmail &lt;span style="color:#0000a0;"&gt;As&lt;/span&gt; MailItem&lt;br /&gt;&lt;span style="color:#0000a0;"&gt;Set&lt;/span&gt; objol = New Outlook.Application&lt;br /&gt;&lt;span style="color:#0000a0;"&gt;Set&lt;/span&gt; objmail = objol.createitem(olmailitem)&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:#0000a0;"&gt;With&lt;/span&gt; objmail&lt;br /&gt;&lt;span style="color:#008000;"&gt;        'enter email address&lt;/span&gt;&lt;br /&gt;        .To = "andrew@excelthoughts.com"&lt;br /&gt;&lt;span style="color:#008000;"&gt;        '.cc = "whoever" 'enter e email address&lt;/span&gt;&lt;br /&gt;        .Subject = "Email"&lt;br /&gt;        .Body = "Please find the attached file"&lt;br /&gt;        .NoAging = &lt;span style="color:#0000a0;"&gt;True&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#008000;"&gt;        'adds attachment to email&lt;/span&gt;&lt;br /&gt;        .Attachments.Add wbname&lt;br /&gt;        .display&lt;br /&gt;    &lt;span style="color:#0000a0;"&gt;End&lt;/span&gt; &lt;span style="color:#0000a0;"&gt;With&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;&lt;span style="color:#008000;"&gt;    'destroy objects&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000a0;"&gt;Set&lt;/span&gt; objmail = &lt;span style="color:#0000a0;"&gt;Nothing&lt;/span&gt;&lt;br /&gt;    &lt;span style="color:#0000a0;"&gt;Set&lt;/span&gt; objol = &lt;span style="color:#0000a0;"&gt;Nothing&lt;/span&gt;&lt;br /&gt;  &lt;br /&gt;&lt;span style="color:#0000a0;"&gt;End&lt;/span&gt; &lt;span style="color:#0000a0;"&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-111769522099428326?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/111769522099428326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=111769522099428326' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111769522099428326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111769522099428326'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/06/controlling-outlook-from-excel.html' title='Controlling Outlook from Excel'/><author><name>Andrew Roberts</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-12670472.post-111708550437788096</id><published>2005-06-01T11:00:00.000+09:30</published><updated>2005-06-08T10:59:43.030+09:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Search'/><title type='text'>Find Text in Hidden Cells</title><content type='html'>&lt;span style="font-family:arial;"&gt;Hi! This is my first ever post, so bear with me as I find my feet.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Excel's Find functionality is getting better as they release new versions, but there is still nothing that will allow you to search through hidden cells for text. I have included a snapshot of code that adds this functionality to the Find function.&lt;br /&gt;&lt;br /&gt;To use it, copy the code into a module and type "FindThis" onto a sheet, hide the row or column and run the FindhiddenText routine. This code can be customised quite a lot e.g. Find All, Find on Multiple sheets etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;font face=Courier New&gt;&lt;SPAN style="color:#00007F"&gt;Option&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Explicit&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Public&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Function&lt;/SPAN&gt; AdvancedFind(rToSearch &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range, _&lt;br&gt;sToFind &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;String&lt;/SPAN&gt;) &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; rFound &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; rHiddenCols &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; rHiddenRows &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'unhide cols/rows&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenCols = UnHideColumns(rToSearch)&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenRows = UnHideRows(rToSearch)&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rFound = rToSearch.Find(what:=sToFind)&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'hide cols/rows&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Call&lt;/SPAN&gt; HideRowsAndColumns(rHiddenCols, rHiddenRows)&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; AdvancedFind = rFound&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Function&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt; HideRowsAndColumns(rHiddenCols &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range, _&lt;br&gt;rHiddenRows &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range)&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; r &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Not&lt;/SPAN&gt; rHiddenCols &lt;SPAN style="color:#00007F"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Each&lt;/SPAN&gt; r &lt;SPAN style="color:#00007F"&gt;In&lt;/SPAN&gt; rHiddenCols.Columns&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;r.Columns.Hidden = &lt;SPAN style="color:#00007F"&gt;True&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Next&lt;/SPAN&gt; r&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Not&lt;/SPAN&gt; rHiddenRows &lt;SPAN style="color:#00007F"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rHiddenRows.Rows.Hidden = &lt;SPAN style="color:#00007F"&gt;True&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt; FindHiddenText()&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; r &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; text &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;String&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;text = "FindThis"&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; r = AdvancedFind(ActiveSheet.Cells, text)&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'display message&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Not&lt;/SPAN&gt; r &lt;SPAN style="color:#00007F"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MsgBox "Found " &amp; text &amp; " at " &amp; r.Address&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Else&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MsgBox text &amp; " not found"&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Sub&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Function&lt;/SPAN&gt; UnHideColumns(rToSearch &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range) &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'''''''''''''''''''''&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; c &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; rHiddenCols &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenCols = &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Each&lt;/SPAN&gt; c &lt;SPAN style="color:#00007F"&gt;In&lt;/SPAN&gt; rToSearch.Columns&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; c.Hidden = &lt;SPAN style="color:#00007F"&gt;True&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'unhide col&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;c.Hidden = &lt;SPAN style="color:#00007F"&gt;False&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'add to union range&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; rHiddenCols &lt;SPAN style="color:#00007F"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenCols = c&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Else&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenCols = Union(rHiddenCols, c)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Next&lt;/SPAN&gt; c&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; UnHideColumns = rHiddenCols&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Function&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Function&lt;/SPAN&gt; UnHideRows(rToSearch &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range) &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#007F00"&gt;'''''''''''''''''''''&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; c &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Dim&lt;/SPAN&gt; rHiddenRows &lt;SPAN style="color:#00007F"&gt;As&lt;/SPAN&gt; Range&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenRows = &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Each&lt;/SPAN&gt; c &lt;SPAN style="color:#00007F"&gt;In&lt;/SPAN&gt; rToSearch.Rows&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; c.Hidden = &lt;SPAN style="color:#00007F"&gt;True&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'unhide col&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#007F00"&gt;'add to union range&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; rHiddenRows &lt;SPAN style="color:#00007F"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenRows = c&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Else&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; rHiddenRows = Union(rHiddenRows, c)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Next&lt;/SPAN&gt; c&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Not&lt;/SPAN&gt; rHiddenRows &lt;SPAN style="color:#00007F"&gt;Is&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Nothing&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Then&lt;/SPAN&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;rHiddenRows.Rows.Hidden = &lt;SPAN style="color:#00007F"&gt;False&lt;/SPAN&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;If&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;Set&lt;/SPAN&gt; UnHideRows = rHiddenRows&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;SPAN style="color:#00007F"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color:#00007F"&gt;Function&lt;/SPAN&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/FONT&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/12670472-111708550437788096?l=www.excelthoughts.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/111708550437788096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=12670472&amp;postID=111708550437788096' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111708550437788096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/12670472/posts/default/111708550437788096'/><link rel='alternate' type='text/html' href='http://www.excelthoughts.com/2005/06/find-text-in-hidden-cells.html' title='Find Text in Hidden Cells'/><author><name>Andrew Roberts</name><email>noreply@blogger.com</email></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry></feed>