<?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:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5263091766606263260</id><updated>2015-04-14T07:59:21.113-07:00</updated><title type='text'>Excel</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default?start-index=26&amp;max-results=25'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>61</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-7653099818158372002</id><published>2015-04-14T07:59:00.001-07:00</published><updated>2015-04-14T07:59:21.125-07:00</updated><title type='text'>Use of symbol # in vba code</title><content type='html'>The type-declaration character for Double is the number sign (#). Also called &lt;em&gt;HASH&lt;/em&gt;&lt;br /&gt;  Other type declaration characters are:&lt;br /&gt;  &lt;ol&gt;&lt;li&gt;Integer %&lt;/li&gt;&lt;li&gt;Long &amp;amp;&lt;/li&gt;&lt;li&gt;Currency @&lt;/li&gt;&lt;li&gt;Single !&lt;/li&gt;&lt;li&gt;Double #&lt;/li&gt;&lt;li&gt;String $&lt;/li&gt;&lt;/ol&gt;&lt;blockquote&gt;  Don&#39;t understand the significance of # here.&lt;br /&gt; &lt;/blockquote&gt;It implies that when the expression is evaluated, the number in front of the type declaration character is treated as a specific data type instead of as a Variant.&lt;br /&gt;  See this example, which are basically the same.&lt;br /&gt;  &lt;pre class=&quot;lang-vb prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Double&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;EDIT&lt;/strong&gt;&lt;br /&gt;  Let me explain it a little more in detail.&lt;br /&gt;  Consider this two procedures&lt;br /&gt;  &lt;pre class=&quot;lang-vb prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Double&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;32767&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Double&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;32767&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;Question&lt;/strong&gt;: One of them will fail. Can you guess which one?&lt;br /&gt;  &lt;strong&gt;Ans&lt;/strong&gt;: The 1st procedure &lt;code&gt;Sub Sample1()&lt;/code&gt; will fail.&lt;br /&gt;  &lt;strong&gt;Reason&lt;/strong&gt;: &lt;br /&gt;  In &lt;code&gt;Sample2&lt;/code&gt;, when you do &lt;code&gt;b * 100#&lt;/code&gt; the result of calculation will be of type &lt;code&gt;Double&lt;/code&gt;. Since it is within the limits of Double, so the calculation succeeds and the result is assigned to variable &lt;code&gt;a&lt;/code&gt;.&lt;br /&gt;  Now in &lt;code&gt;Sample1&lt;/code&gt;,  when you do &lt;code&gt;b * 100&lt;/code&gt; the result of calculation will be of type &lt;code&gt;Integer&lt;/code&gt;,  since both the operands are of type integer. But the result of  calculation exceeds the limits of Integer storage. As a result it will  error out.</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/7653099818158372002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/04/use-of-symbol-in-vba-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7653099818158372002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7653099818158372002'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/04/use-of-symbol-in-vba-code.html' title='Use of symbol # in vba code'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-7853824392233366027</id><published>2015-04-10T11:20:00.002-07:00</published><updated>2015-04-10T11:20:21.317-07:00</updated><title type='text'>Dictionary for VBA</title><content type='html'>&lt;h3&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; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Comparing Dictionaries and Arrays&lt;/h3&gt;A dictionary is a general-purpose data  structure that looks like a linked list but acts like a &quot;super array.&quot;  Like VBScript arrays, dictionaries store data and make that data  available through one variable. (If you&#39;re unfamiliar with VBScript  arrays, see my July 1999 column.) However, dictionaries differ from  arrays in many ways, including&lt;br /&gt;&lt;ul class=&quot;articlelist&quot;&gt;&lt;li&gt;                                A dictionary has additional methods to add new items and check for existing items.&lt;/li&gt;&lt;li&gt;                                You don&#39;t need to call ReDim to extend the dictionary&#39;s size.&lt;/li&gt;&lt;li&gt;                                When you delete a particular item from a  dictionary, all the subsequent items automatically shift up. For  example, if you delete the second item in a three-item dictionary, the  original third item automatically shifts up into the second-item slot.&lt;/li&gt;&lt;li&gt;                                You use keys to identify dictionary  items. Keys can be any data subtype, except an array or dictionary.&lt;/li&gt;&lt;li&gt;                                A dictionary can&#39;t be multidimensional.  (Although you can&#39;t store arrays or dictionaries in a dictionary item,  you can store dictionaries in array items.)&lt;/li&gt;&lt;/ul&gt;The most important reason for using a  dictionary instead of an array is that a dictionary is more flexible and  is richer in terms of built-in functionality. Dictionaries work better  than arrays when you need to access random elements frequently.  Dictionaries also work better when you want to locate items by their  content rather than their position.&lt;br /&gt;&lt;h3&gt;                               Creating a Dictionary&lt;/h3&gt;A&lt;a href=&quot;http://windowsitpro.com/article/vbscript/the-scripting-dictionary-makes-it-easy-39312&quot; target=&quot;_blank&quot;&gt; dictionary is a COM object (called the Dictionary object)&lt;/a&gt; that is available through the Microsoft Scripting Runtime library. The  Dictionary object isn&#39;t part of the VBScript runtime engine but rather a  separate COM object that Microsoft bundles with any installation of  VBScript and JScript. As a result, you can use the Dictionary object in  any COM-compliant script, including VBScript, JScript, and Perl scripts.&lt;br /&gt;                                To create a Dictionary object in VBScript  code, you use the CreateObject function with the programmatic  identifier (ProgID) of Scripting.Dictionary:&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Dim dict&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Set dict = CreateObject _&lt;/li&gt;&lt;br /&gt;&lt;li&gt;(&quot;Scripting.Dictionary&quot;)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;After you&#39;ve created an instance of the Dictionary object, you&#39;re ready to add items to it.&lt;br /&gt;&lt;h3&gt;                               Adding Items&lt;/h3&gt;To add items to a dictionary, you use the  Add method. You can&#39;t insert an item in a specific position in a  dictionary; any item you add automatically appears at the bottom of the  dictionary.&lt;br /&gt;                               The Add method has the syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Add key, item&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;dObject&lt;/em&gt; is the Dictionary object you want to add items to. You must specify two arguments. The first argument, &lt;em&gt;key,&lt;/em&gt; specifies the unique key you want to use to identify the item. The second argument, &lt;em&gt;item,&lt;/em&gt; is the value you want the item to store. For example, the code&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dict.Add &quot;Italy&quot;, &quot;Rome&quot;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;dict.Add &quot;Germany&quot;, &quot;Berlin&quot;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;adds two items to the dictionary named &lt;em&gt;dict.&lt;/em&gt; The first item&#39;s value is Rome. You use the key Italy to access this  item. The second item&#39;s value is Berlin. You use the key Germany to  access this item. In other words, you&#39;re adding two &lt;em&gt;key-value &lt;/em&gt;pairs—Italy-Rome and Germany-Berlin—to this dictionary.&lt;br /&gt;                                In a key-value pair, only the key must be  unique. A dictionary can have key-value pairs that have the same value.  For example, a dictionary might include the items &lt;em&gt;Today&#39;s grocery list-Milk&lt;/em&gt; and &lt;em&gt;Tomorrow&#39;s grocery list-Milk.&lt;/em&gt;&lt;br /&gt;                                If you attempt to add a key-value pair  but the key you specify already exists in that dictionary, you receive a  runtime error. To avoid this error, you can use the Exists method,  which checks whether a key is unique. This method has the syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Exists(key)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;key&lt;/em&gt; is the key you want to check. This method returns True if the key  exists and False if it doesn&#39;t. You can use this method in code similar  to that in &lt;a href=&quot;http://windowsitpro.com/content/content/8797/listing_01.txt&quot;&gt;Listing 1&lt;/a&gt;.  This code checks the key of a new key-value pair before adding the item  to the dictionary. If the key already exists, you receive the message &lt;em&gt;Please specify a new key&lt;/em&gt; rather than a runtime error. If the key doesn&#39;t exist, the code adds the item&#39;s key and value.&lt;br /&gt;                                As I mentioned earlier, a key can be any  data subtype, except an array or dictionary. (For information about the  various VBScript subtypes, see my June 1999 column.) For example, you  can create a dictionary that uses unique integers rather than strings  for keys:&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dict.Add 1, &quot;Rome&quot;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;dict.Add 2, &quot;Berlin&quot;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;Although using integers or other subtypes  is permissible, most scriptwriters use strings because strings are the  most readable.&lt;br /&gt;&lt;h3&gt;                               Retrieving Items&lt;/h3&gt;To retrieve existing items in a  dictionary, you use the Item property. This read/write property has the  syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Item(key)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;key&lt;/em&gt; is the key of the item whose value you want to read. For example, if  you want to retrieve and display the value that the Italy item holds,  you specify&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;MsgBox dict.Item(&quot;Italy&quot;)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;However, you can also use the abbreviated syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;MsgBox dict(&quot;Italy&quot;)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;to display the value Rome because the Item property is the Dictionary object&#39;s default property.&lt;br /&gt;                                If the key is a string, the case in which  you specify the key is important. By default, the Dictionary object  makes a binary comparison when it tries to find a match between the  specified key and the stored keys. Thus, the comparison is case  sensitive. So, for example, the code&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;MsgBox dict(&quot;ITALY&quot;)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;won&#39;t display a value because you  initially entered the key in title case (i.e., Italy) not upper case  (i.e., ITALY). If you try to retrieve a key that doesn&#39;t exist, you  don&#39;t get an error but rather an empty string.&lt;br /&gt;                                If you want to make a case-insensitive  comparison, you can use the Dictionary object&#39;s CompareMode property.  The code&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dict.CompareMode = _&lt;/li&gt;&lt;br /&gt;&lt;li&gt;vbTextCompare&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;forces the object to apply a textual  comparison when searching for a match. Therefore, the comparison is case  insensitive. You can set the CompareMode property only when the  dictionary is empty. Attempting to set this property for a nonempty  dictionary results in an error.&lt;br /&gt;&lt;h3&gt;                               Enumerating Items&#39; Keys and Values&lt;/h3&gt;VBScript arrays use progressive 0- or  1-based indexes—numbers over which you have no control—to identify  items. As a result, you can easily locate an item based on its position  in the array, but you can&#39;t easily locate an item based on its content.  Dictionaries use keys—strings or numbers over which you have complete  control—to identify items. As a result, you can easily locate an item  based on its content but not so easily locate an item based on its  position. No workaround exists to make arrays support customizable keys;  however, you can use a workaround to make dictionaries behave like  indexed arrays.&lt;br /&gt;                                To begin, let&#39;s walk through a dictionary and enumerate all  the items&#39; values and keys. You can use a For Each...Next statement such  as&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;For Each elem In dict&lt;/li&gt;&lt;br /&gt;&lt;li&gt;MsgBox elem &amp;amp; &quot; - &quot; _&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&amp;amp; dict(elem)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Next&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;elem&lt;/em&gt; is a variable that represents each item&#39;s key (not its value). For each  item in the dictionary, you display the key and the value concatenated  together with a hyphen in between. To retrieve the key, you specify &lt;em&gt;elem.&lt;/em&gt; To retrieve the value, you use the abbreviated Item property; however,  instead of hard-coding the key, you specify the elem variable as the  argument.&lt;br /&gt;                               You can rewrite this For Each...Next statement so that it uses indexes, as &lt;a href=&quot;http://windowsitpro.com/content/content/8797/listing_02.txt&quot; target=&quot;_blank&quot;&gt;Listing 2&lt;/a&gt; shows. In Listing 2, you begin by creating an array called &lt;em&gt;arr.&lt;/em&gt; Next, you use the Dictionary object&#39;s Items method, which fills an  array with all the values in a dictionary. The Items method has the  syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Items()&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;Including the parentheses after &lt;em&gt;Items &lt;/em&gt;is optional. However, as you&#39;ll see shortly, including them is a good habit to get into.&lt;br /&gt;                               In Listing 2, you&#39;re using the Items method to fill &lt;em&gt;arr&lt;/em&gt; with the values in &lt;em&gt;dict&lt;/em&gt;.  After filling the array, you use the For...Next statement to traverse  it and display all the values in one message box. Because you might not  know how many values are in the array, you use the Count property to  read the number of items that the Dictionary object has. By subtracting 1  from that number, you get the array&#39;s upper bound.&lt;br /&gt;                                Because the Items method returns an array  filled with all a dictionary&#39;s values, you can use this method to  access a dictionary&#39;s content through indexes. You just need to specify  which index you want to access with the syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Items()(i)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;i &lt;/em&gt;is  a variable index representing the index of the dictionary item you want  to access. For example, if you want to access and display the first  item, you specify&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;MsgBox dict.Items()(0)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;Thus, you can access an item in a  dictionary without knowing the item&#39;s key. However, when you use  indexes, you must remember to specify the index number in the second set  of parentheses. If you use the code&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;MsgBox dict.Items(0)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;you&#39;ll receive an error, which is why  including the empty parentheses after the Items method is a good habit  to get into.&lt;br /&gt;                                Instead of filling an array with a dictionary&#39;s values, you can  fill an array with a dictionary&#39;s keys. You use the Keys method, which  has the syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Keys()&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;If you want to use an index to access a dictionary item&#39;s key, you use the code&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Keys()(i)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;i&lt;/em&gt; is a variable index representing the index of the dictionary item for which you want to specify the key.&lt;br /&gt;&lt;h3&gt;                               Deleting Items and Changing Keys&lt;/h3&gt;To delete an item, you use the Remove  method, which takes the key of the item you want to delete as its sole  argument. For example, if you want to remove the key-value pair of  Italy-Rome, you specify&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dict.Remove (&quot;Italy&quot;)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;When you remove an item, all the items  after the one you removed shift up one position. In addition, the value  of the Count property changes.&lt;br /&gt;                               The Remove method accepts only keys as arguments. If you want to remove the &lt;em&gt;i&lt;/em&gt;th item from a Dictionary object, you need to use a workaround that uses the Remove and Keys methods:&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dict.Remove dict.Keys()(i)&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;i&lt;/em&gt; is a variable index representing the index of the dictionary item you  want to delete. If you want to delete all the items in a dictionary, you  use the RemoveAll method. As the syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.RemoveAll&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;shows, RemoveAll doesn&#39;t take any  arguments. Using RemoveAll is significantly faster than removing each  item individually, especially if the dictionary has a lot of items.&lt;br /&gt;                                If you want to change a key in a  key-value pair, you don&#39;t need to delete the item then add a new one.  Instead, you can use the Key property to change the key. This property  has the syntax&lt;br /&gt;&lt;pre&gt;&lt;div class=&quot;geshifilter&quot;&gt;&lt;br /&gt;&lt;div class=&quot;text geshifilter-text&quot;&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;dObject.Key(key) = newkey&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/pre&gt;where &lt;em&gt;key&lt;/em&gt; is the key you want to change and &lt;em&gt;newkey&lt;/em&gt; is the key you want to change it to.&lt;br /&gt;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    &lt;br /&gt;                                You can&#39;t change a value in a key-value  pair. If you want a different value, you need to delete the item, then  add a new one.</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/7853824392233366027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/04/dictionary-for-vba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7853824392233366027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7853824392233366027'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/04/dictionary-for-vba.html' title='Dictionary for VBA'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-3422753445441428018</id><published>2015-01-22T11:42:00.003-08:00</published><updated>2015-01-22T11:42:50.638-08:00</updated><title type='text'>Variable Cell Reference</title><content type='html'>Question:&lt;br /&gt;If I want to return a value from a specific cell ie B3 you type in =B3,  but in my case the row value is variable and I&#39;m using a Vlookup  function to determine the row, so I&#39;m using the formula =&quot;B&quot;&amp;amp;A1  where A1 = the value &quot;8&quot;, but in the cell just =B* appears, not the  contents of cell B8.&lt;br /&gt;&lt;br /&gt;In other words I want a formula to display the value of a specific cell,  the column is fixed but the row is variable and is determined by  another formula. &lt;br /&gt;&lt;br /&gt;solution:&lt;br /&gt;=indirect(&quot;B&quot;&amp;amp;A1)       &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Another example: &lt;br /&gt;&lt;br /&gt;=SUM(INDIRECT(&quot;&#39;MM&#39;!G&quot;&amp;amp;&#39;BE Summary&#39;!$AZ$2+1+A10):INDIRECT(&quot;&#39;MM&#39;!H&quot;&amp;amp;&#39;BE Summary&#39;!$AZ$2+1+A10))&lt;br /&gt;&lt;br /&gt;In example above, if cell AZ on tab &#39;BE Summary&quot; = 10 and cell A10 on current sheet is 2 then the formula become =SUM(&#39;MM&#39;!G13:&#39;MM&#39;!H13)&lt;br /&gt;note:&amp;nbsp; 10 + 1 + 2 = 13</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/3422753445441428018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/01/variable-cell-reference.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3422753445441428018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3422753445441428018'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/01/variable-cell-reference.html' title='Variable Cell Reference'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-5075109239889857715</id><published>2015-01-22T08:48:00.001-08:00</published><updated>2015-03-06T12:18:57.009-08:00</updated><title type='text'>Remove custom styles in Excel using vba (also bring back default styles if missing)</title><content type='html'>Sub TrimStyles()&lt;br /&gt;Dim s As Variant&lt;br /&gt;Dim g As Style&lt;br /&gt;On Error Resume Next&lt;br /&gt;With ActiveWorkbook&lt;br /&gt;For Each g In .Styles&lt;br /&gt;If g.BuiltIn = False Then&lt;br /&gt;s = g.Value&lt;br /&gt;.Styles(s).Delete&lt;br /&gt;End If&lt;br /&gt;Next g&lt;br /&gt;On Error GoTo 0&lt;br /&gt;End With&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;If still cannot delete some custom styles, use steps below&lt;br /&gt;1. open excel file with unzip program such as winzip, winrar.&lt;br /&gt;2. go to folder xl then open styles.xml with a text editor program such as notepad.&lt;br /&gt;3. search for &quot;cellStyles&quot; then delete the unwanted custom styles. (Also search for &quot;cellstyle&quot; if &quot;cellStyles&quot; not found)&lt;br /&gt;4. search &amp;nbsp;customBuiltin=&quot;1&quot; for default styles and change &quot;1&quot; to &quot;0&quot; in case you want to delete the custom changes on default styles.</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/5075109239889857715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/01/remove-custom-styles-in-excel-using-vba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5075109239889857715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5075109239889857715'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/01/remove-custom-styles-in-excel-using-vba.html' title='Remove custom styles in Excel using vba (also bring back default styles if missing)'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-16566806061574279</id><published>2015-01-22T08:43:00.002-08:00</published><updated>2015-01-26T09:08:58.764-08:00</updated><title type='text'>Excel Keyboard shortcut</title><content type='html'>&lt;b&gt;Insert a New Row or Column&lt;/b&gt;&lt;br /&gt;Method 1: &lt;br /&gt;Select the current row: Shift+SpaceBar &lt;br /&gt;Insert a row (above the currently selected row): Ctrl+&quot;+&quot; &lt;br /&gt;To insert a new column, in Step 1 use Ctrl+SpaceBar to select the current column. &lt;br /&gt;To delete a row (or column) after it is selected, press Ctrl+&quot;-&quot;&lt;br /&gt;Method 2:&lt;br /&gt;Alt-i, r = insert row&lt;br /&gt;Alt-i, c = insert column&lt;br /&gt;&amp;nbsp;If you want to repeat and do more of each, you could just hit F4. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Autofill&lt;/b&gt;&lt;br /&gt;Ctrl+R is fill to the right (Ctrl+D is fill down)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Display result of part of the formula &lt;/b&gt;&lt;br /&gt;Highlight part of formula, press F9 to display result of that part of the formula &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Show formulas instead of calculated values for entire sheet&lt;/b&gt;&lt;br /&gt;Ctrl+&quot;`&quot;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/16566806061574279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/01/excel-keyboard-shortcut.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/16566806061574279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/16566806061574279'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2015/01/excel-keyboard-shortcut.html' title='Excel Keyboard shortcut'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-9068221537248211979</id><published>2014-02-27T12:20:00.004-08:00</published><updated>2014-02-27T12:24:24.510-08:00</updated><title type='text'>Auto Fill VBA</title><content type='html'>Public Sub MyAutoFill()&lt;br /&gt;&lt;br /&gt;&#39;Declare range Variables&lt;br /&gt;Dim selection1 As Range&lt;br /&gt;Dim selection2 As Range&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Set selection1 = Sheet1.Range(&quot;A1:A2&quot;)&lt;br /&gt;Set selection2 = Sheet1.Range(&quot;A1:A20&quot;)&lt;br /&gt;&#39;Autofill&lt;br /&gt;selection1.AutoFill Destination:=selection2&lt;br /&gt;&lt;br /&gt;End Sub</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/9068221537248211979/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/02/auto-fill-vba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/9068221537248211979'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/9068221537248211979'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/02/auto-fill-vba.html' title='Auto Fill VBA'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-5725841072616811075</id><published>2014-02-03T10:43:00.002-08:00</published><updated>2014-02-03T10:43:32.216-08:00</updated><title type='text'>How to find or replace asterisk(*) and question mark(?) in Excel?</title><content type='html'>Asterisk and question mark are excel’s wildcard characters. If you try to search or replace them in excel they won’t show up. Like if you ever try to replace the * in a formula within a cell with Blank, your whole cell will go blank.  To overcome this problem, you need to add tilde(~) key before the multiplication sign(*) or question mark (?) sign in find and replace box.</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/5725841072616811075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/02/how-to-find-or-replace-asterisk-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5725841072616811075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5725841072616811075'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/02/how-to-find-or-replace-asterisk-and.html' title='How to find or replace asterisk(*) and question mark(?) in Excel?'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-7486810054943713517</id><published>2014-01-31T11:57:00.001-08:00</published><updated>2015-01-22T08:44:21.288-08:00</updated><title type='text'>F9 in Excel to Display result of part of the formula</title><content type='html'>Highlight part of formula, press F9 to display result of that part of the formula </content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/7486810054943713517/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/01/f9-in-excel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7486810054943713517'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7486810054943713517'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/01/f9-in-excel.html' title='F9 in Excel to Display result of part of the formula'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-5549147369681640943</id><published>2014-01-13T08:30:00.002-08:00</published><updated>2014-01-13T08:30:51.527-08:00</updated><title type='text'>Excel coverts General or Number format to Date or other format automatically when reopen</title><content type='html'>Go to Home tab ==&gt; style section ==&gt; Normal ==&gt; Modify ==&gt; Format ==&gt; Select General</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/5549147369681640943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/01/excel-coverts-general-or-number-format.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5549147369681640943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5549147369681640943'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2014/01/excel-coverts-general-or-number-format.html' title='Excel coverts General or Number format to Date or other format automatically when reopen'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-3410703186767766590</id><published>2013-11-25T08:39:00.003-08:00</published><updated>2013-11-25T08:39:45.594-08:00</updated><title type='text'>Use of symbol in VBA variables</title><content type='html'>The type declaration characters are:  &lt;ol&gt;&lt;li&gt;Integer %&lt;/li&gt;&lt;li&gt;Long &amp;amp;&lt;/li&gt;&lt;li&gt;Currency @&lt;/li&gt;&lt;li&gt;Single !&lt;/li&gt;&lt;li&gt;Double #&lt;/li&gt;&lt;li&gt;String $&lt;/li&gt;&lt;/ol&gt;It implies that when the expression is evaluated, the number in front of the type declaration character is treated as a specific data type instead of as a Variant.&lt;br /&gt;  See example below, which are basically the same.&lt;br /&gt;  &lt;pre class=&quot;lang-vb prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Double&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1.2&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Consider this two procedures below:&lt;br /&gt;  &lt;pre class=&quot;lang-vb prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Double&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;32767&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; Sample2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Dim&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; a &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Double&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;As&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Integer&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;32767&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;    a &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; b &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;#&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;    Debug&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Print a&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;End&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;Sub&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;strong&gt;Question&lt;/strong&gt;: One of them will fail. Can you guess which one?&lt;br /&gt;  &lt;strong&gt;Ans&lt;/strong&gt;: The 1st procedure &lt;code&gt;Sub Sample1()&lt;/code&gt; will fail.&lt;br /&gt;  &lt;strong&gt;Reason&lt;/strong&gt;: &lt;br /&gt;  In &lt;code&gt;Sample2&lt;/code&gt;, when you do &lt;code&gt;b * 100#&lt;/code&gt; the result of calculation will be of type &lt;code&gt;Double&lt;/code&gt;. Since it is within the limits of Double, so the calculation succeeds and the result is assigned to variable &lt;code&gt;a&lt;/code&gt;.&lt;br /&gt;  Now in &lt;code&gt;Sample1&lt;/code&gt;,  when you do &lt;code&gt;b * 100&lt;/code&gt; the result of calculation will be of type &lt;code&gt;Integer&lt;/code&gt;,  since both the operands are of type integer. But the result of  calculation exceeds the limits of Integer storage. As a result it will  error out.</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/3410703186767766590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/11/use-of-symbol-in-vba-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3410703186767766590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3410703186767766590'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/11/use-of-symbol-in-vba-variables.html' title='Use of symbol in VBA variables'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-904983763425321459</id><published>2013-04-15T11:41:00.001-07:00</published><updated>2013-04-15T11:50:09.458-07:00</updated><title type='text'>Esc key or other cancel key event</title><content type='html'>&lt;br /&gt;Use Application.EnableCancelKey =&lt;br /&gt;Controls how Microsoft Excel handles CTRL+BREAK (or ESC or COMMAND+PERIOD)&lt;br /&gt;user interruptions to the running procedure.&lt;br /&gt;&lt;br /&gt;xlDisabled:&lt;br /&gt;&amp;nbsp;Cancel key trapping is completely disabled.&lt;br /&gt;&lt;br /&gt;xlInterrupt:&lt;br /&gt;&amp;nbsp;The current procedure is interrupted, and the user can debug or&lt;br /&gt;end the procedure.&lt;br /&gt;&lt;br /&gt;xlErrorHandler:&lt;br /&gt;&amp;nbsp;The interrupt is sent to the running procedure as an error,&lt;br /&gt;trappable by an error handler set up with an On Error GoTo statement.&lt;br /&gt;The trappable error code is 18.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;font-family: Consolas, Courier, monospace; font-size: 14px; line-height: 18px; overflow: auto; padding: 5px;&quot;&gt;example:&lt;/pre&gt;&lt;pre style=&quot;font-family: Consolas, Courier, monospace; font-size: 14px; line-height: 18px; overflow: auto; padding: 5px;&quot;&gt;On Error GoTo handleCancel &lt;br /&gt;Application.EnableCancelKey = xlErrorHandler &lt;br /&gt;MsgBox &quot;This may take a long time: press ESC to cancel&quot; &lt;br /&gt;For x = 1 To 1000000 &#39; Do something 1,000,000 times (long!) &lt;br /&gt; &#39; do something here &lt;br /&gt;Next x &lt;br /&gt; &lt;br /&gt;handleCancel: &lt;br /&gt;If Err = 18 Then &lt;br /&gt; MsgBox &quot;You cancelled&quot; &lt;br /&gt;End If&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Remarks&lt;br /&gt;Use this property very carefully. If you use xlDisabled, there&#39;s no way&lt;br /&gt;to interrupt a runaway loop or other non self-terminating code.&lt;br /&gt;Likewise, if you use xlErrorHandler but your error handler always&lt;br /&gt;returns using the Resume statement, there&#39;s no way to stop runaway code.&lt;br /&gt;The EnableCancelKey property is always reset to xlInterrupt whenever&lt;br /&gt;Microsoft Excel returns to the idle state and there&#39;s no code running.&lt;br /&gt;To trap or disable cancellation in your procedure, you must explicitly&lt;br /&gt;change the EnableCancelKey property every time the procedure is called.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/904983763425321459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/04/esc-key-or-other-cancel-key-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/904983763425321459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/904983763425321459'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/04/esc-key-or-other-cancel-key-event.html' title='Esc key or other cancel key event'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-2327790732887243130</id><published>2013-03-18T11:37:00.001-07:00</published><updated>2013-03-18T11:37:10.616-07:00</updated><title type='text'>VBA send e-mail </title><content type='html'>&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Sub&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;Send_Email_Using_VBA()&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Dim&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;Email_Subject, Email_Send_From, Email_Send_To, _&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;Email_Cc, Email_Bcc, Email_Body&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;As&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;String&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Dim&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;Mail_Object, Mail_Single&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;As&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Variant&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;Email_Subject = &quot;Trying&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;to&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;send email using VBA&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;Email_Send_From = &quot;databison@gmail.com&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;Email_Send_To = &quot;databison@gmail.com&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;Email_Cc = &quot;databison@gmail.com&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;Email_Bcc = &quot;databison@gmail.com&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;Email_Body = &quot;Congratulations!!!! You have successfully sent an e-mail using VBA !!!!&quot;&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;On&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Error&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;GoTo&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;debugs&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Set&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;Mail_Object = CreateObject(&quot;Outlook.Application&quot;)&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Set&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;Mail_Single = Mail_Object.CreateItem(0)&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;With&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;Mail_Single&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;.Subject = Email_Subject&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;To&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;= Email_Send_To&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;.cc = Email_Cc&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;.BCC = Email_Bcc&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;.Body = Email_Body&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;.send&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;End&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;With&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;debugs:&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;If&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;Err.Description &amp;lt;&amp;gt; &quot;&quot;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Then&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;MsgBox Err.Description&lt;/span&gt;&lt;br style=&quot;background-color: white; border: 0px; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot; /&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;End&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Monaco, &#39;Lucida Console&#39;, monospace; font-size: 12px; line-height: 16.796875px; white-space: nowrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;background-color: white; border: 0px; color: blue; font-family: &#39;Courier New&#39;, &#39;Lucida Console&#39;; font-size: 12px; line-height: 16.796875px; margin: 0px; padding: 0px; white-space: nowrap;&quot;&gt;Sub&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/2327790732887243130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/vba-send-e-mail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2327790732887243130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2327790732887243130'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/vba-send-e-mail.html' title='VBA send e-mail '/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-1267035186427869448</id><published>2013-03-18T11:36:00.002-07:00</published><updated>2013-03-18T11:36:31.318-07:00</updated><title type='text'>VBA check e-mail input</title><content type='html'>&lt;br /&gt;Function IsEmailAddress(txt As String) As Boolean&lt;br /&gt;&amp;nbsp; &amp;nbsp; With CreateObject(&quot;VBScript.RegExp&quot;)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .Pattern = &quot;^[\w-\.]+@([\w-]+\.)+[A-Za-z]{2,3}$&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IsEmailAddress = .test(txt)&lt;br /&gt;&amp;nbsp; &amp;nbsp; End With&lt;br /&gt;End Function&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/1267035186427869448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/vba-check-e-mail-input.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/1267035186427869448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/1267035186427869448'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/vba-check-e-mail-input.html' title='VBA check e-mail input'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-7185965555721254512</id><published>2013-03-13T21:07:00.001-07:00</published><updated>2013-03-13T21:19:51.613-07:00</updated><title type='text'>How to look up a value in a list and return multiple corresponding values</title><content type='html'>&lt;br /&gt;Identify the row numbers that contain the name&amp;nbsp;$A$10 in column A (Use Row(1:1) because Data starts in row1)&lt;br /&gt;&lt;br /&gt;=SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1))&lt;br /&gt;&lt;br /&gt;Return the corresponding values from column B, &lt;br /&gt;&lt;br /&gt;=INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1)),2)&lt;br /&gt;&lt;br /&gt;and remove possible error values.&lt;br /&gt;&lt;br /&gt;=IF(ISERROR(INDEX($A$1:$B$7,SMALL( IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1)),2)),&quot;&quot;,INDEX($A$1:$B$7,SMALL(IF($A$1:$A$7=$A$10,ROW($A$1:$A$7)),ROW(1:1)),2))&lt;br /&gt;&lt;br /&gt;Use (CTRL+SHIFT+ENTER) to input formula</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/7185965555721254512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/how-to-look-up-value-in-list-and-return.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7185965555721254512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7185965555721254512'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/how-to-look-up-value-in-list-and-return.html' title='How to look up a value in a list and return multiple corresponding values'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-4838145443538528492</id><published>2013-03-12T13:50:00.000-07:00</published><updated>2013-03-13T21:01:40.082-07:00</updated><title type='text'>VBA Set Dynamic Chart Minimum and Maximum etc</title><content type='html'>Option Explicit&lt;br /&gt;Private Sub ChangeAxisScales()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; With ActiveSheet.ChartObjects(&quot;Chart 1&quot;).Chart&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; Category (X) Axis, use .Axes(xlCategory,&amp;nbsp;xlPrimary)&amp;nbsp;for primary if&amp;nbsp;there&amp;nbsp;is secondary axis.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With .Axes(xlCategory)&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; .MaximumScale = ActiveSheet.Range(&quot;$E$2&quot;).Value&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; .MinimumScale = ActiveSheet.Range(&quot;$E$3&quot;).Value&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; .MajorUnit = ActiveSheet.Range(&quot;$E$4&quot;).Value&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; Value (Y) Axis&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With .Axes(xlValue)&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; .MaximumScale = ActiveSheet.Range(&quot;$F$2&quot;).Value&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; .MinimumScale = ActiveSheet.Range(&quot;$F$3&quot;).Value&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; .MajorUnit = ActiveSheet.Range(&quot;$F$4&quot;).Value&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/4838145443538528492/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/vba-set-dynamic-chart-minimum-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/4838145443538528492'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/4838145443538528492'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/03/vba-set-dynamic-chart-minimum-and.html' title='VBA Set Dynamic Chart Minimum and Maximum etc'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-5641437058408290061</id><published>2013-02-27T15:45:00.002-08:00</published><updated>2013-02-27T15:45:13.836-08:00</updated><title type='text'>Check if a user form is loaded</title><content type='html'>&lt;br /&gt;&lt;pre class=&quot;bbcode_code&quot; style=&quot;height: 156px;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;Function&lt;/span&gt; IsUserFormLoaded(&lt;span class=&quot;keyword&quot;&gt;ByVal&lt;/span&gt; UFName &lt;span class=&quot;keyword&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;String&lt;/span&gt;) &lt;span class=&quot;keyword&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;Boolean&lt;/span&gt; &lt;br /&gt;    &lt;span class=&quot;keyword&quot;&gt;Dim&lt;/span&gt; UForm &lt;span class=&quot;keyword&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;Object&lt;/span&gt; &lt;br /&gt;     &lt;br /&gt;    IsUserFormLoaded = &lt;span class=&quot;keyword&quot;&gt;False&lt;/span&gt; &lt;br /&gt;    &lt;span class=&quot;keyword&quot;&gt;For Each&lt;/span&gt; UForm &lt;span class=&quot;keyword&quot;&gt;In&lt;/span&gt; VBA.UserForms &lt;br /&gt;        &lt;span class=&quot;keyword&quot;&gt;If&lt;/span&gt; UForm.Name = UFName &lt;span class=&quot;keyword&quot;&gt;Then&lt;/span&gt; &lt;br /&gt;            IsUserFormLoaded = &lt;span class=&quot;keyword&quot;&gt;True&lt;/span&gt; &lt;br /&gt;            Exit &lt;span class=&quot;keyword&quot;&gt;For&lt;/span&gt; &lt;br /&gt;        &lt;span class=&quot;keyword&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;keyword&quot;&gt;If&lt;/span&gt; &lt;br /&gt;    &lt;span class=&quot;keyword&quot;&gt;Next&lt;/span&gt; &lt;br /&gt;&lt;span class=&quot;keyword&quot;&gt;End Function&lt;/span&gt; &lt;span class=&quot;comment&quot;&gt;&#39;IsUserFormLoaded&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/5641437058408290061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/check-if-user-form-is-loaded.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5641437058408290061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/5641437058408290061'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/check-if-user-form-is-loaded.html' title='Check if a user form is loaded'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-8369826952504624014</id><published>2013-02-26T10:40:00.004-08:00</published><updated>2013-02-26T10:40:58.933-08:00</updated><title type='text'>Solver in Excel and VBA</title><content type='html'>&lt;br /&gt;&lt;h5&gt;Quoted from&amp;nbsp;http://peltiertech.com/Excel/SolverVBA.html&lt;/h5&gt;&lt;b&gt;Solver&lt;/b&gt; is a powerful analysis tool, bundled with Excel and used for  optimization and simulation of business and engineering models. It can be even  more powerful if used in conjunction with VBA, to automate solving of multiple  models which use different input parameters and constraints.&lt;br /&gt; In a simple example, there are two factors in B5 and B6. The product  (&lt;tt&gt;=B5*B6&lt;/tt&gt;) is calculated in B8. Solver will be used to find the maximum  value of the target cell (the product in B8), subject to the constraint that  both factors (B5:B6) shall not exceed a value of 4. Select Solver from the Tools  menu, and enter the appropriate conditions and constraints in the Solver  Parameters dialog.&lt;br /&gt; &lt;div align=&quot;center&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;299&quot; src=&quot;http://peltiertech.com/Excel/pix6/SolverExample1.png&quot; width=&quot;691&quot; /&gt;&lt;/div&gt;Click the Solve button, and another dialog indicates whether a solution is  found and offers some options.&lt;br /&gt; &lt;div align=&quot;center&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;213&quot; src=&quot;http://peltiertech.com/Excel/pix6/SolverExample2.png&quot; width=&quot;691&quot; /&gt;&lt;/div&gt;If you &lt;b&gt;record a macro&lt;/b&gt; while you use Solver, you will get something  like the following:&lt;br /&gt; &lt;table align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; cellpadding=&quot;10&quot; style=&quot;width: 85%px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;Sub SolverMacro1()&lt;br /&gt;&#39;&lt;br /&gt;&#39; SolverMacro1 Macro&lt;br /&gt;&#39; Macro recorded by Jon Peltier&lt;br /&gt;&#39;&lt;br /&gt;    SolverOk SetCell:=&quot;$B$8&quot;, MaxMinVal:=1, ValueOf:=&quot;0&quot;, ByChange:=&quot;$B$5:$B$6&quot;&lt;br /&gt;    SolverAdd CellRef:=&quot;$B$5:$B$6&quot;, Relation:=1, FormulaText:=&quot;4&quot;&lt;br /&gt;    SolverOk SetCell:=&quot;$B$8&quot;, MaxMinVal:=1, ValueOf:=&quot;0&quot;, ByChange:=&quot;$B$5:$B$6&quot;&lt;br /&gt;    SolverSolve&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;tt&gt;SolverAdd&lt;/tt&gt; adds constraints to the Solver model. &lt;tt&gt;SolverOK&lt;/tt&gt;  defines the cell to optimize, how to optimize it, and what cells to change  during the Solver optimization. The macro recorder wrote this line twice, so the  first occurrence can be removed. To prevent parameters from a different Solver  optimization interfering with the macro&#39;s optimization, Solver should be reset  prior to running, using &lt;tt&gt;SolverReset&lt;/tt&gt;. &lt;tt&gt;SolverSolve&lt;/tt&gt; has an  optional &lt;tt&gt;UserFinish&lt;/tt&gt; argument; if &lt;tt&gt;UserFinish&lt;/tt&gt; is False or  omitted, the second dialog shown above will ask the user whether to save the  optimization, but if &lt;tt&gt;UserFinish&lt;/tt&gt; is True, Solver will end without the  dialog. A modified Solver macro is shown below:&lt;br /&gt; &lt;table align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; cellpadding=&quot;10&quot; style=&quot;width: 85%px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;Sub SolverMacro2()&lt;br /&gt;&#39;&lt;br /&gt;&#39; SolverMacro2 Macro&lt;br /&gt;&#39; Macro fixed up by Jon Peltier&lt;br /&gt;&#39;&lt;br /&gt;    SolverReset&lt;br /&gt;    SolverAdd CellRef:=&quot;$B$5:$B$6&quot;, Relation:=1, FormulaText:=&quot;4&quot;&lt;br /&gt;    SolverOk SetCell:=&quot;$B$8&quot;, MaxMinVal:=1, ValueOf:=&quot;0&quot;, ByChange:=&quot;$B$5:$B$6&quot;&lt;br /&gt;    SolverSolve True&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;When you try to run this macro, you get a compile error. The command  &lt;tt&gt;SolverReset&lt;/tt&gt; is highlighted, and the following error message  appears.&lt;br /&gt; &lt;div align=&quot;center&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;327&quot; src=&quot;http://peltiertech.com/Excel/pix6/Solver_CompileError.png&quot; width=&quot;707&quot; /&gt;&lt;/div&gt;In order to use a macro based on an installed add-in, you must first make  sure that the add-in is installed, then you must set a reference to the add-in  in the workbook containing the code that calls the add-in&#39;s procedures.&lt;br /&gt; To &lt;b&gt;install an add-in&lt;/b&gt;, on Excel&#39;s Tools menu, choose Add-Ins. If the  add-in is shown on the list, check the box in front of its name. If the add-in  is not found, click Browse, navigate to the add-in file*, then when it appears  on the add-in list, check its checkbox. Solver was already installed, or we  would not have been able to record a macro using it.&lt;br /&gt; *Depending on your Office and Windows versions, the default Excel add-ins  library is &quot;C:\Program Files\Microsoft Office\OFFICE11\Library&quot; or &quot;C:\Documents  and Settings\{username}\Application Data\Microsoft\AddIns&quot;. By default in Excel  2003, Solver is located in &quot;C:\Program Files\Microsoft  Office\OFFICE11\Library\SOLVER&quot;.&lt;br /&gt; &lt;div align=&quot;center&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;490&quot; src=&quot;http://peltiertech.com/Excel/pix6/Tools_AddIns.png&quot; width=&quot;494&quot; /&gt;  &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;img border=&quot;0&quot; height=&quot;372&quot; src=&quot;http://peltiertech.com/Excel/pix6/AddIns_Solver.png&quot; width=&quot;326&quot; /&gt;&lt;/div&gt;To &lt;b&gt;set a reference to an add-in&lt;/b&gt;, it must first be installed. Then on  the VB Editor&#39;s Tools menu, select References. This lists all open workbooks and  installed add-ins, as well as a huge list of resources installed on the host  computer. Find the add-in in the list, and check the box in front of its  name.&lt;br /&gt; &lt;div align=&quot;center&quot;&gt;&lt;img align=&quot;top&quot; border=&quot;0&quot; height=&quot;282&quot; src=&quot;http://peltiertech.com/Excel/pix6/Tools_References.png&quot; width=&quot;502&quot; /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;img border=&quot;0&quot; height=&quot;364&quot; src=&quot;http://peltiertech.com/Excel/pix6/References_Solver.png&quot; width=&quot;449&quot; /&gt;&lt;/div&gt;&lt;table align=&quot;center&quot; border=&quot;0&quot; style=&quot;width: 750px;&quot;&gt;&lt;tbody&gt;&lt;tr valign=&quot;center&quot;&gt;&lt;td&gt;With a reference set to Solver, SolverMacro2 will run as expected. In  addition, the Solver library will be accessible through the VB Editor&#39;s Object  Browser (right), and you will have the benefit of Intellisense (below) while  editing code that uses members of the Solver library.&lt;/td&gt;&lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;div align=&quot;center&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;477&quot; src=&quot;http://peltiertech.com/Excel/pix6/Solver_ObjectBrowser.png&quot; width=&quot;400&quot; /&gt;&lt;br /&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;3&quot;&gt;&lt;div align=&quot;center&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;327&quot; src=&quot;http://peltiertech.com/Excel/pix6/Solver_IntelliSense.png&quot; width=&quot;707&quot; /&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;a href=&quot;&quot; name=&quot;Solver2&quot;&gt;&lt;hr /&gt;&lt;/a&gt;&lt;h5&gt;Avoiding Solver Reference Problems&lt;/h5&gt;The code you write to run Solver will work on your computer, and on any  computer with the same versions of Excel and Solver. In fact, it should work on  any computer that has later versions of Excel and Solver. If you want to  distribute your workbook with VBA code written for Solver, you should write the  code using the earliest expected version of Excel (e.g., Excel 2000), so it will  work on all versions that users may have installed (e.g., Excel 2000, 2002, and  2003). When the workbook is first opened on a given computer, it finds the  references resources, or more recent versions if available.&lt;br /&gt; This sounds easy, but sometimes it isn&#39;t. Perhaps you developed a workbook in  Excel 2003 for your department to use, but you have to send it to a supplier,  and the supplier hasn&#39;t upgraded past Excel 2000. Or perhaps the workbook must  be shared amongst a group of users who have different versions of Excel and  Solver installed. In these cases, a computer with an earlier version of Solver  installed will choke on the reference to a later version of Solver.&lt;br /&gt; It is possible, of course, to install add-ins and set references using VBA.  This can be tricky, and in Microsoft Office 2002 and later, the user has to  grant permission for VBA code to access any VB projects. Without this  permission, references to installed components cannot be set.&lt;br /&gt; To avoid issues with installing add-ins and setting references to various  resources, your code can be modified so that it is called using  &lt;tt&gt;Application.Run&lt;/tt&gt;. Without a reference to the add-in, you lose  IntelliSense and the Object Browser, and your code suffers from a small  (probably imperceptible) performance penalty. However, you gain simpler, more  reliable execution. The syntax is straightforward: &lt;tt&gt;Application.Run&lt;/tt&gt; is  followed by the procedure name in double quotes, followed by a comma separated  list of arguments being passed to the procedure: &lt;br /&gt;&lt;pre&gt;Application.Run &quot;SubName&quot;, Argument1, Argument2,...&lt;br /&gt;&lt;/pre&gt;If &lt;tt&gt;Application.Run&lt;/tt&gt; is used to return the calculated result of a  function, the syntax is slightly different, with a variable set equal to  &lt;tt&gt;Application.Run&lt;/tt&gt;, with the procedure and arguments enclosed within  parentheses:&lt;br /&gt;&lt;pre&gt;MyVariable = Application.Run(&quot;Function&quot;, Argument1, Argument2,...)&lt;br /&gt;&lt;/pre&gt;The SolverMacro2 procedure above is easily modified to use  &lt;tt&gt;Application.Run&lt;/tt&gt;: &lt;br /&gt; &lt;table align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; cellpadding=&quot;10&quot; style=&quot;width: 85%px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;Sub SolverMacro3()&lt;br /&gt;&#39;&lt;br /&gt;&#39; SolverMacro3 Macro&lt;br /&gt;&#39; Macro fixed up by Jon Peltier&lt;br /&gt;&#39; Edited to use Application.Run to avoid reference problems&lt;br /&gt;&#39;&lt;br /&gt;    Application.Run &quot;SolverReset&quot;&lt;br /&gt;    Application.Run &quot;SolverAdd&quot;, &quot;$B$5:$B$6&quot;, 1, &quot;4&quot;&lt;br /&gt;    Application.Run &quot;SolverOk&quot;, &quot;$B$8&quot;, 1, &quot;0&quot;, &quot;$B$5:$B$6&quot;&lt;br /&gt;    Application.Run &quot;SolverSolve&quot;, True&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;A more general version of a Solver procedure is shown below. This includes  more informative comments, and it provides a notice to the user about the  success of the Solver optimization.&lt;br /&gt; &lt;table align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; cellpadding=&quot;10&quot; style=&quot;width: 85%px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;Sub RunSolver()&lt;br /&gt;  &#39;&#39; Adjusted for Application.Run() to avoid Reference problems with Solver &lt;br /&gt;  &#39;&#39; Peltier Technical Services, Inc., Copyright © 2007. All rights reserved.&lt;br /&gt;&lt;br /&gt;  &#39; reset&lt;br /&gt;  Application.Run &quot;Solver.xla!SolverReset&quot;&lt;br /&gt;&lt;br /&gt;  &#39; set up new analysis&lt;br /&gt;  Application.Run &quot;Solver.xla!SolverOk&quot;, &quot;Blah1&quot;, 1, , &quot;BlahBlah1&quot;&lt;br /&gt;&lt;br /&gt;  &#39; add constraints&lt;br /&gt;  Application.Run &quot;Solver.xla!SolverAdd&quot;, &quot;Blah2&quot;, 3, 0&lt;br /&gt;  Application.Run &quot;Solver.xla!SolverAdd&quot;, &quot;Blah3&quot;, 2, &quot;BlahBlah3&quot;&lt;br /&gt;&lt;br /&gt;  &#39; run the analysis&lt;br /&gt;  Result = Application.Run(&quot;Solver.xla!SolverSolve&quot;, True)&lt;br /&gt;&lt;br /&gt;  &#39; finish the analysis&lt;br /&gt;  Application.Run &quot;Solver.xla!SolverFinish&quot;&lt;br /&gt;&lt;br /&gt;  &#39; report on success of analysis&lt;br /&gt;  If Result &amp;lt;= 3 Then&lt;br /&gt;    &#39; Result = 0, Solution found, optimality and constraints satisfied&lt;br /&gt;    &#39; Result = 1, Converged, constraints satisfied&lt;br /&gt;    &#39; Result = 2, Cannot improve, constraints satisfied&lt;br /&gt;    &#39; Result = 3, Stopped at maximum iterations&lt;br /&gt;    MsgBox &quot;Solver found a solution&quot;, vbInformation, &quot;SOLUTION FOUND&quot;&lt;br /&gt;  Else&lt;br /&gt;    &#39; Result = 4, Solver did not converge&lt;br /&gt;    &#39; Result = 5, No feasible solution&lt;br /&gt;    Beep&lt;br /&gt;    MsgBox &quot;Solver was unable to find a solution.&quot;, vbExclamation, &quot;SOLUTION NOT FOUND&quot;&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The results of the &lt;tt&gt;SolverSolve&lt;/tt&gt; function include:&lt;br /&gt;&lt;pre&gt;      0  Solver found a solution. All constraints and optimality conditions are satisfied. &lt;br /&gt;      1  Solver has converged to the current solution. All constraints are satisfied. &lt;br /&gt;      2  Solver cannot improve the current solution. All constraints are satisfied. &lt;br /&gt;      3  Stop chosen when the maximum iteration limit was reached. &lt;br /&gt;      4  The Set Cell values do not converge. &lt;br /&gt;      5  Solver could not find a feasible solution. &lt;br /&gt;      6  Solver stopped at user&#39;s request. &lt;br /&gt;      7  The conditions for Assume Linear Model are not satisfied. &lt;br /&gt;      8  The problem is too large for Solver to handle. &lt;br /&gt;      9  Solver encountered an error value in a target or constraint cell. &lt;br /&gt;     10  Stop chosen when maximum time limit was reached. &lt;br /&gt;     11  There is not enough memory available to solve the problem. &lt;br /&gt;     12  Another Excel instance is using SOLVER.DLL. Try again later. &lt;br /&gt;     13  Error in model. Please verify that all cells and constraints are valid. &lt;/pre&gt;&lt;a href=&quot;&quot; name=&quot;Solver3&quot;&gt;&lt;hr /&gt;&lt;/a&gt;&lt;h5&gt;Preparing Solver for First Use&lt;/h5&gt;One frequent complaint about automating Solver is that it doesn&#39;t work using  VBA until it has been used at least once manually. This is because Solver  installs itself in a kind of &quot;on demand&quot; mode. Unlike a regularly-installed  add-in, it is not opened until it is first used. And until it is first used, it  hasn&#39;t run its Auto_Open procedure, which is what actually prepares it to run.  Using VBA you can bypass the initial manual Solver operation with this  command:&lt;br /&gt;&lt;pre&gt;Application.Run &quot;Solver.xla!Solver.Solver2.Auto_open&quot;&lt;/pre&gt;This command should be run before the first Solver optimization procedure is  executed. I have developed a Solver initialization routine that first makes sure  the computer even has Solver, then it installs it and runs its Auto_Open  procedure. The procedure is written as a function, which returns True if Solver  is available and ready to use. I usually call this procedure from the parent  workbook&#39;s Workbook_Open event procedure. If CheckSolver is False, I usually  have the workbook close itself after a brief warning to the user.&lt;br /&gt; &lt;table align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; cellpadding=&quot;10&quot; style=&quot;width: 85%px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;Function CheckSolver() As Boolean&lt;br /&gt;  &#39;&#39; Adjusted for Application.Run() to avoid Reference problems with Solver &lt;br /&gt;  &#39;&#39; Peltier Technical Services, Inc., Copyright © 2007. All rights reserved.&lt;br /&gt;  &#39;&#39; Returns True if Solver can be used, False if not.&lt;br /&gt;&lt;br /&gt;  Dim bSolverInstalled As Boolean&lt;br /&gt;&lt;br /&gt;  &#39;&#39; Assume true unless otherwise&lt;br /&gt;  CheckSolver = True&lt;br /&gt;&lt;br /&gt;  On Error Resume Next&lt;br /&gt;  &#39; check whether Solver is installed&lt;br /&gt;  bSolverInstalled = Application.AddIns(&quot;Solver Add-In&quot;).Installed&lt;br /&gt;  Err.Clear&lt;br /&gt;&lt;br /&gt;  If bSolverInstalled Then&lt;br /&gt;    &#39; uninstall temporarily&lt;br /&gt;    Application.AddIns(&quot;Solver Add-In&quot;).Installed = False&lt;br /&gt;    &#39; check whether Solver is installed (should be false)&lt;br /&gt;    bSolverInstalled = Application.AddIns(&quot;Solver Add-In&quot;).Installed&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  If Not bSolverInstalled Then&lt;br /&gt;    &#39; (re)install Solver &lt;br /&gt;    Application.AddIns(&quot;Solver Add-In&quot;).Installed = True&lt;br /&gt;    &#39; check whether Solver is installed (should be true)&lt;br /&gt;    bSolverInstalled = Application.AddIns(&quot;Solver Add-In&quot;).Installed&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  If Not bSolverInstalled Then&lt;br /&gt;    MsgBox &quot;Solver not found. This workbook will not work.&quot;, vbCritical&lt;br /&gt;    CheckSolver = False&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  If CheckSolver Then&lt;br /&gt;    &#39; initialize Solver &lt;br /&gt;    Application.Run &quot;Solver.xla!Solver.Solver2.Auto_open&quot;&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  On Error GoTo 0&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;The function above works fine for English versions of Excel, but in other  languages, the name of the add-in may not be &quot;Solver Add-In&quot;. We have to be a  bit more clever, and introduce a loop to check the filenames of all add-ins. The  CheckSolverIntl function below calls two additional functions which perform the  loops. This function still relies on Solver being named &quot;solver.xla&quot;. If this is  not the case, change the value of the constant sAddIn in this procedure, and  please email me about it.&lt;br /&gt; &lt;table align=&quot;center&quot; bgcolor=&quot;#ffffff&quot; border=&quot;1&quot; cellpadding=&quot;10&quot; style=&quot;width: 85%px;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;Function CheckSolverIntl() As Boolean&lt;br /&gt;  &#39;&#39; Adjusted for Application.Run() to avoid Reference problems with Solver&lt;br /&gt;  &#39;&#39; Adjusted for international versions of Excel&lt;br /&gt;  &#39;&#39; Peltier Technical Services, Inc., Copyright © 2008. All rights reserved.&lt;br /&gt;  &#39;&#39; Returns True if Solver can be used, False if not.&lt;br /&gt;&lt;br /&gt;  Dim bSolverInstalled As Boolean&lt;br /&gt;  Dim bAddInFound As Boolean&lt;br /&gt;  Dim iAddIn As Long&lt;br /&gt;  Const sAddIn As String = &quot;solver.xla&quot;&lt;br /&gt;&lt;br /&gt;  &#39;&#39; Assume true unless otherwise&lt;br /&gt;  CheckSolverIntl = True&lt;br /&gt;&lt;br /&gt;  On Error Resume Next&lt;br /&gt;  &#39; check whether Solver is installed&lt;br /&gt;  bSolverInstalled = IsInstalled(sAddIn)&lt;br /&gt;  Err.Clear&lt;br /&gt;&lt;br /&gt;  If bSolverInstalled Then&lt;br /&gt;    &#39; uninstall temporarily&lt;br /&gt;    bAddInFound = AddInInstall(sAddIn, False)&lt;br /&gt;    &#39; check whether Solver is installed (should be false)&lt;br /&gt;    bSolverInstalled = IsInstalled(sAddIn)&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  If Not bSolverInstalled Then&lt;br /&gt;    &#39; (re)install Solver&lt;br /&gt;    bAddInFound = AddInInstall(sAddIn, True)&lt;br /&gt;    &#39; check whether Solver is installed (should be true)&lt;br /&gt;    bSolverInstalled = IsInstalled(sAddIn)&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  If Not bSolverInstalled Then&lt;br /&gt;    MsgBox &quot;Solver not found. This workbook will not work.&quot;, vbCritical&lt;br /&gt;    CheckSolverIntl = False&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  If CheckSolverIntl Then&lt;br /&gt;    &#39; initialize Solver&lt;br /&gt;    Application.Run &quot;Solver.xla!Solver.Solver2.Auto_open&quot;&lt;br /&gt;  End If&lt;br /&gt;&lt;br /&gt;  On Error GoTo 0&lt;br /&gt;&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function IsInstalled(sAddInFileName As String) As Boolean&lt;br /&gt;  Dim iAddIn As Long&lt;br /&gt;  &lt;br /&gt;  IsInstalled = False&lt;br /&gt;  &lt;br /&gt;  For iAddIn = 1 To Application.AddIns.Count&lt;br /&gt;    With Application.AddIns(iAddIn)&lt;br /&gt;      If LCase$(.Name) = LCase$(sAddInFileName) Then&lt;br /&gt;        If .Installed Then&lt;br /&gt;          IsInstalled = True&lt;br /&gt;        End If&lt;br /&gt;        Exit For&lt;br /&gt;      End If&lt;br /&gt;    End With&lt;br /&gt;  Next&lt;br /&gt;  &lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function AddInInstall(sAddInFileName As String, bInstall As Boolean) As Boolean&lt;br /&gt;  Dim iAddIn As Long&lt;br /&gt;  &lt;br /&gt;  For iAddIn = 1 To Application.AddIns.Count&lt;br /&gt;    With Application.AddIns(iAddIn)&lt;br /&gt;      If LCase$(.Name) = LCase$(sAddInFileName) Then&lt;br /&gt;        If .Installed &amp;lt;&amp;gt; bInstall Then&lt;br /&gt;          .Installed = bInstall&lt;br /&gt;        End If&lt;br /&gt;        AddInInstall = True &#39; True = add-in is listed&lt;br /&gt;        Exit For&lt;br /&gt;      End If&lt;br /&gt;    End With&lt;br /&gt;  Next&lt;br /&gt;  &lt;br /&gt;End Function&lt;br /&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/8369826952504624014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/solver-in-excel-and-vba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/8369826952504624014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/8369826952504624014'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/solver-in-excel-and-vba.html' title='Solver in Excel and VBA'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-1015052535558556756</id><published>2013-02-12T14:23:00.001-08:00</published><updated>2013-02-12T14:23:24.113-08:00</updated><title type='text'>VBA Error handling</title><content type='html'>From Microsoft website:&lt;br /&gt;&lt;br /&gt;Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.  The following is an example of the basic structure of a macro that uses error-handling:&lt;br /&gt;&lt;div class=&quot;kb_codebody&quot;&gt;&lt;div class=&quot;kb_codecontent&quot;&gt;&lt;code&gt;&lt;pre class=&quot;code&quot;&gt;   Sub MyMacro()&lt;br /&gt;&lt;br /&gt;        On Error GoTo ErrorHandler&lt;br /&gt;        . . .&lt;br /&gt;        Exit Sub&lt;br /&gt;&lt;br /&gt;   ErrorHandler:&lt;br /&gt;        . . .&lt;br /&gt;        Resume &amp;lt;or Exit Sub&amp;gt;&lt;br /&gt;        . . .&lt;br /&gt;&lt;br /&gt;   End Sub&lt;br /&gt;    &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;The example contains the following elements: an On Error statement (On Error GoTo ErrorHandler) and a Resume statement. The error handler might contain an Error Statement and/or an Error function. Each of these elements is discussed in greater detail in later sections of this article.&lt;br /&gt;&lt;br /&gt;Note that in this example an Exit Sub statement precedes the error handler label. By placing Exit Sub or Exit Function before the error handling routine, you prevent the error-handling code from being run when the macro runs without error.&lt;h3 id=&quot;tocHeadRef&quot;&gt;On Error Statement&lt;/h3&gt;&lt;script&gt;&lt;/script&gt;The On Error statement enables your application to handle errors that your macro encounters. If you do not use an On Error statement in your procedures, any run-time error that occurs is fatal: that is, Microsoft Excel will generate a run-time error message and the macro will stop running.&lt;br /&gt;&lt;br /&gt;The following table outlines the On Error statement syntax and describes each type of statement.   &lt;h3 id=&quot;tocHeadRef&quot;&gt;This On Error statement  Does the following&lt;/h3&gt;&lt;script&gt;&lt;/script&gt;&lt;ul&gt;&lt;li&gt;   On Error GoTo &amp;lt;line&amp;gt;&lt;br /&gt;   Enables the error-handling routine that starts at &amp;lt;line&amp;gt;, which is   any line label or line number. The specified line must be in the   same procedure as the On Error statement.&lt;/li&gt;&lt;li&gt;   On Error Resume Next&lt;br /&gt;   Specifies that when a run-time error occurs, control goes to the   statement immediately following the statement where the error   occurred. In other words, execution continues.&lt;/li&gt;&lt;li&gt;   On Error GoTo 0&lt;br /&gt;   Disables any enabled error handler in the current procedure.&lt;/li&gt;&lt;/ul&gt;&lt;h3 id=&quot;tocHeadRef&quot;&gt;Resume Statement&lt;/h3&gt;&lt;script&gt;&lt;/script&gt;Your error-handling routine will need to determine where macro control should go when an error has occurred. To end the macro when an error has occurred, place the error handling routine either immediately before the End Sub (or End Function) statement or use the Exit Sub (or Exit Function) statement. To return control to another location within the macro, use the Resume statement.   &lt;h3 id=&quot;tocHeadRef&quot;&gt;This Resume   statement      Does the following&lt;/h3&gt;&lt;script&gt;&lt;/script&gt;&lt;ul&gt;&lt;li&gt;   Resume [0]&lt;br /&gt;   Resumes macro execution with the line that caused the error. [0] is   an optional argument.&lt;/li&gt;&lt;li&gt;   Resume Next&lt;br /&gt;   Resumes macro execution with the line following the line that caused   the error.&lt;/li&gt;&lt;li&gt;   Resume &amp;lt;line&amp;gt;&lt;br /&gt;   Resumes macro execution at the line number or line label specified   by &amp;lt;line&amp;gt;.&lt;/li&gt;&lt;/ul&gt;NOTE: A very common mistake in writing error handling routines is to use a GoTo statement in the routine to specify where macro control should go. Generally, it is not recommended that you use GoTo in an error handling routine; you should use the Resume statement to resume macro execution outside of the error handler.&lt;h3 id=&quot;tocHeadRef&quot;&gt;Error Statement and Error Function&lt;/h3&gt;&lt;script&gt;&lt;/script&gt;You can make your error-handling routine more effective by determining what error has occurred. When a run-time error occurs, you can use the Err function to determine the error number; the Error statement is used to get the text that describes the error. For example, you can use the following statement to display the description of the error that was encountered:&lt;div class=&quot;kb_codebody&quot;&gt;&lt;div class=&quot;kb_codecontent&quot;&gt;&lt;code&gt;&lt;pre class=&quot;code&quot;&gt;   MsgBox Err &amp;amp; &quot;: &quot; &amp;amp; Error(Err)&lt;br /&gt;    &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;If the error handling routine encountered the error 13 (a type mismatch error), the following text would appear in a dialog box:&lt;div class=&quot;kb_errormsgbody&quot;&gt;&lt;div class=&quot;kb_errorcontent&quot;&gt;&lt;div class=&quot;errormsg&quot;&gt;   13: Type Mismatch&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3 id=&quot;tocHeadRef&quot;&gt;EXAMPLES OF MACROS THAT USE ERROR HANDLING&lt;/h3&gt;&lt;script&gt;&lt;/script&gt;In these examples, the error handler may be called if there is no disk in drive B, if the B:\XLFiles path cannot be located, or if there is no Book1.xls file in the B:\XLFiles folder (directory).&lt;h4 id=&quot;tocHeadRef&quot;&gt;Example 1--Basic Error Handling Macro&lt;/h4&gt;&lt;script&gt;&lt;/script&gt;&lt;div class=&quot;kb_codebody&quot;&gt;&lt;div class=&quot;kb_codecontent&quot;&gt;&lt;code&gt;&lt;pre class=&quot;code&quot;&gt;   Sub MyMacro()&lt;br /&gt;&lt;br /&gt;      Dim MyWorkbook As Workbook&lt;br /&gt;&lt;br /&gt;      &#39; Run the Error handler &quot;ErrHandler&quot; when an error occurs.&lt;br /&gt;      On Error GoTo Errhandler&lt;br /&gt;&lt;br /&gt;      ChDrive &quot;B:&quot;&lt;br /&gt;      ChDir &quot;B:\&quot;&lt;br /&gt;      ChDir &quot;B:\XLFiles&quot;&lt;br /&gt;      Workbooks.Open &quot;Book1.xls&quot;&lt;br /&gt;&lt;br /&gt;      &#39; Disable the error handler.&lt;br /&gt;      On Error GoTo 0&lt;br /&gt;&lt;br /&gt;      Set MyWorkbook = ActiveWorkbook&lt;br /&gt;      MsgBox &quot;The destination workbook is &quot; &amp;amp; MyWorkbook.Name&lt;br /&gt;&lt;br /&gt;      &#39; Exit the macro so that the error handler is not executed.&lt;br /&gt;      Exit Sub&lt;br /&gt;&lt;br /&gt;   Errhandler:&lt;br /&gt;&lt;br /&gt;      &#39; If an error occurs, display a message and end the macro.&lt;br /&gt;      MsgBox &quot;An error has occurred. The macro will end.&quot;&lt;br /&gt;&lt;br /&gt;   End Sub&lt;br /&gt;    &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;This example uses the On Error statement to display a message and end a macro when an error occurs. If an error occurs in the macro, the error handler displays the following error message and the macro execution is halted:&lt;div class=&quot;kb_errormsgbody&quot;&gt;&lt;div class=&quot;kb_errorcontent&quot;&gt;&lt;div class=&quot;errormsg&quot;&gt;   An error has occurred. The macro will end.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If the workbook Book1.xls is successfully opened, a message is displayed, showing the destination workbook, and the macro ends because there is an Exit Sub statement before the error handler label &quot;ErrHandler.&quot;&lt;h4 id=&quot;tocHeadRef&quot;&gt;Example 2--Error Handling Macro That Displays a Specific Error Message&lt;/h4&gt;&lt;script&gt;&lt;/script&gt;This next example is similar to the macro in Example 1; however, this macro implements the Error statement and the Err function to show a more descriptive error message when an error is encountered.&lt;div class=&quot;kb_codebody&quot;&gt;&lt;div class=&quot;kb_codecontent&quot;&gt;&lt;code&gt;&lt;pre class=&quot;code&quot;&gt;   Sub MyMacro()&lt;br /&gt;&lt;br /&gt;      Dim MyWorkbook As Workbook&lt;br /&gt;&lt;br /&gt;      &#39; Run the Error handler &quot;ErrHandler&quot; when an error occurs.&lt;br /&gt;&lt;br /&gt;      On Error GoTo Errhandler&lt;br /&gt;      ChDrive &quot;B:&quot;&lt;br /&gt;      ChDir &quot;B:\&quot;&lt;br /&gt;      ChDir &quot;B:\XLFiles&quot;&lt;br /&gt;      Workbooks.Open &quot;Book1.xls&quot;&lt;br /&gt;&lt;br /&gt;      &#39; Disable the error handler.&lt;br /&gt;      On Error GoTo 0&lt;br /&gt;&lt;br /&gt;      Set MyWorkbook = ActiveWorkbook&lt;br /&gt;      MsgBox &quot;The destination workbook is &quot; &amp;amp; MyWorkbook.Name&lt;br /&gt;&lt;br /&gt;      &#39; Exit the macro so that the error handler is not executed.&lt;br /&gt;      Exit Sub&lt;br /&gt;&lt;br /&gt;   Errhandler:&lt;br /&gt;&lt;br /&gt;      Select Case Err&lt;br /&gt;&lt;br /&gt;         Case 68, 75:    &#39; Error 68: &quot;Device not available&quot;&lt;br /&gt;                         &#39; Error 75: &quot;Path/File Access Error&quot;&lt;br /&gt;            MsgBox &quot;There is an error reading drive B.&quot;&lt;br /&gt;&lt;br /&gt;         Case 76:        &#39; Error 76: &quot;Path not found&quot;&lt;br /&gt;            MsgBox &quot;The specified path is not found.&quot;&lt;br /&gt;&lt;br /&gt;         Case Else:      &#39; An error other than 68, 75 or 76 has occurred.&lt;br /&gt;            &#39; Display the error number and the error text.&lt;br /&gt;            MsgBox &quot;Error # &quot; &amp;amp; Err &amp;amp; &quot; : &quot; &amp;amp; Error(Err)&lt;br /&gt;&lt;br /&gt;      End Select&lt;br /&gt;&lt;br /&gt;      &#39; End the macro.&lt;br /&gt;   End Sub&lt;br /&gt;    &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;If an error occurs in the macro one of the following will occur:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If the error is either 68 or 75, the message &quot;There is an error   reading drive B&quot; will be displayed, and the macro will end.&lt;/li&gt;&lt;li&gt;If the error is 76, the message &quot;The specified path is not found&quot;   will be displayed, and the macro will end.&lt;/li&gt;&lt;li&gt;If the error is an error other than 68, 75, or 76, the message   &quot;Error &amp;lt;error number&amp;gt;: &amp;lt;error text&amp;gt;&quot; will be displayed and the macro   will end.&lt;/li&gt;&lt;/ul&gt;If the Book1.xls workbook is successfully opened, then a message will be displayed showing the destination workbook and the macro will end because there is an Exit Sub statement before the error handler label &quot;ErrHandler.&quot;&lt;h4 id=&quot;tocHeadRef&quot;&gt;Example 3--Macro that Uses the Resume Statement&lt;/h4&gt;&lt;script&gt;&lt;/script&gt;This next example uses the Resume statement to resume macro execution based on choices that the user makes when an error occurs.&lt;div class=&quot;kb_codebody&quot;&gt;&lt;div class=&quot;kb_codecontent&quot;&gt;&lt;code&gt;&lt;pre class=&quot;code&quot;&gt;   Sub MyMacro()&lt;br /&gt;&lt;br /&gt;   Dim Result as Integer&lt;br /&gt;   Dim ErrMsg as String&lt;br /&gt;   Dim MyWorkbook as Workbook&lt;br /&gt;&lt;br /&gt;      &#39; Run the Error handler &quot;ErrHandler&quot; when an error occurs.&lt;br /&gt;      On Error GoTo Errhandler&lt;br /&gt;&lt;br /&gt;      ChDrive &quot;B:&quot;&lt;br /&gt;      ChDir &quot;B:\&quot;&lt;br /&gt;      ChDir &quot;B:\XLfiles&quot;&lt;br /&gt;&lt;br /&gt;      Workbooks.Open &quot;Book1.xls&quot;&lt;br /&gt;&lt;br /&gt;   NewWorkbook:&lt;br /&gt;&lt;br /&gt;      &#39; Disable the error handler.&lt;br /&gt;      On Error GoTo 0&lt;br /&gt;&lt;br /&gt;      Set MyWorkbook = ActiveWorkbook&lt;br /&gt;      MsgBox &quot;The destination workbook is &quot; &amp;amp; MyWorkbook.Name&lt;br /&gt;&lt;br /&gt;      &#39; Exit the macro so that the error handler is not executed.&lt;br /&gt;      Exit Sub&lt;br /&gt;&lt;br /&gt;   Errhandler:&lt;br /&gt;&lt;br /&gt;      Select Case Err&lt;br /&gt;&lt;br /&gt;         Case 68, 75:  &#39; Error 68: &quot;Device not available&quot;&lt;br /&gt;                       &#39; Error 75: &quot;Path/File access error&lt;br /&gt;            ErrMsg =  &quot;There is an error reading drive B. Please &quot; &amp;amp; _&lt;br /&gt;               &quot;insert a disk and then press OK to continue or &quot; &amp;amp; _&lt;br /&gt;               &quot;press Cancel to end this operation.&quot;&lt;br /&gt;&lt;br /&gt;            Result = MsgBox(ErrMsg, vbOKCancel)&lt;br /&gt;&lt;br /&gt;            &#39; Resume at the line where the error occurred if the user&lt;br /&gt;            &#39; clicks OK; otherwise end the macro.&lt;br /&gt;            If Result = vbOK Then Resume&lt;br /&gt;&lt;br /&gt;         Case 76:     &#39; Error 76: Path not found&lt;br /&gt;            ErrMsg = &quot;The disk in drive B does not have an XLFiles &quot; &amp;amp; _&lt;br /&gt;               &quot;directory. Please insert the correct disk.&quot;&lt;br /&gt;&lt;br /&gt;            Result = MsgBox(ErrMsg, vbOKCancel)&lt;br /&gt;&lt;br /&gt;            &#39; Resume at the line where the error occurred if the user&lt;br /&gt;            &#39; clicks OK; otherwise end the macro.&lt;br /&gt;            If Result = vbOK Then Resume&lt;br /&gt;&lt;br /&gt;         Case Else:   &#39; A different error occurred.&lt;br /&gt;&lt;br /&gt;            ErrMsg = &quot;An error has occurred opening &quot; &amp;amp; _&lt;br /&gt;                 &quot;B:\XLFiles\Book1.xls. Use the active workbook as &quot; &amp;amp; _&lt;br /&gt;                 &quot;the destination?&quot;&lt;br /&gt;&lt;br /&gt;            Result = MsgBox(ErrMsg, vbYesNo)&lt;br /&gt;&lt;br /&gt;            &#39; Resume at the label &quot;NewWorkbook&quot; if the user clicks Yes;&lt;br /&gt;            &#39; otherwise end the macro.&lt;br /&gt;            If Result = vbYes Then Resume NewWorkbook&lt;br /&gt;&lt;br /&gt;      End Select&lt;br /&gt;&lt;br /&gt;   &#39; End the macro.&lt;br /&gt;   End Sub&lt;br /&gt;    &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;If the workbook Book1.xls is successfully opened, a message will be displayed showing the destination workbook as Book1.xls and the macro will end because there is an Exit Sub statement before the error handler label &quot;ErrHandler.&quot; If an error occurs in the macro, the error handler will do one of the following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If the error is either 68 or 75, then the following message is   displayed:&lt;div class=&quot;kb_errormsgbody&quot;&gt;&lt;div class=&quot;kb_errorcontent&quot;&gt;&lt;div class=&quot;errormsg&quot;&gt;      There is an error reading drive B. Please insert a disk and then      press OK to continue or press Cancel to end this operation.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If the user clicks OK in this dialog box, the macro resumes at the   line where the error occurred. If the user clicks Cancel, the macro   will end.&lt;/li&gt;&lt;li&gt;If the error is 76, then the following message will be displayed:&lt;div class=&quot;kb_errormsgbody&quot;&gt;&lt;div class=&quot;kb_errorcontent&quot;&gt;&lt;div class=&quot;errormsg&quot;&gt;      The disk in drive B does not have an XLFiles directory. Please      insert the correct disk.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If the user clicks OK in this dialog box, the macro resumes at the   line where the error occurred. If the user clicks Cancel, the macro   will end.&lt;/li&gt;&lt;li&gt;If the error is an error other than 68, 75 or 76, then the following   error message  is displayed:&lt;div class=&quot;kb_errormsgbody&quot;&gt;&lt;div class=&quot;kb_errorcontent&quot;&gt;&lt;div class=&quot;errormsg&quot;&gt;      An error has occurred opening B:\XLFiles\Book1.xls. Use the      active workbook as the destination?&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;If the user clicks Yes in the dialog box, the macro resumes at the   line labeled &quot;NewWorkbook.&quot; The currently active workbook is   displayed as the destination workbook. If the user clicks No, the   macro will end.&lt;/li&gt;&lt;/ul&gt;&lt;h4 id=&quot;tocHeadRef&quot;&gt;Example 4--Centralizing Error Handling&lt;/h4&gt;&lt;script&gt;&lt;/script&gt;You can reduce the length of overall code in your application by centralizing the error handling. You can centralize error-handling by creating one or more procedures that handle common errors.&lt;br /&gt;&lt;br /&gt;The following is a procedure called ErrorHandling that will display a message corresponding to the error number (ErrorValue) that was passed to it and, where possible, allow the user to choose a button to specify which action should be taken following the error. Based on the choice that the user makes, the ErrorHandling procedure will return a value (ReturnValue) for the course of action to the calling procedure. The ReturnValue can be Err_Exit (exit the macro where the error occurred), Err_Resume (resume at the line in the macro where the error occurred), or Err_Resume_Next (resume at the line following the line in the macro where the error occurred).&lt;div class=&quot;kb_codebody&quot;&gt;&lt;div class=&quot;kb_codecontent&quot;&gt;&lt;code&gt;&lt;pre class=&quot;code&quot;&gt;   Public Const Err_Exit = 0&lt;br /&gt;   Public Const Err_Resume = 1&lt;br /&gt;   Public Const Err_Resume_Next = 2&lt;br /&gt;&lt;br /&gt;   Sub ErrorHandling(ErrorValue As Integer, ReturnValue As Integer)&lt;br /&gt;&lt;br /&gt;      Dim Result as Integer&lt;br /&gt;      Dim ErrMsg as String&lt;br /&gt;      Dim Choices as Integer&lt;br /&gt;&lt;br /&gt;      Select Case ErrorValue&lt;br /&gt;&lt;br /&gt;         Case 68:     &#39; Device  not available.&lt;br /&gt;&lt;br /&gt;            ErrMsg = &quot;The device you are trying to access is either &quot; &amp;amp; _&lt;br /&gt;               &quot;not online or does not exist. Retry?&quot;&lt;br /&gt;            Choices = vbOKCancel&lt;br /&gt;&lt;br /&gt;         Case 75:     &#39; Path/File access error.&lt;br /&gt;&lt;br /&gt;            ErrMsg = &quot;There is an error accessing the path and/or &quot; &amp;amp; _&lt;br /&gt;                 &quot;file specified. Retry?&quot;&lt;br /&gt;            Choices = vbOKCancel&lt;br /&gt;&lt;br /&gt;         Case 76:     &#39; Path not found.&lt;br /&gt;&lt;br /&gt;            ErrMsg = &quot;The path and/or file specified was not found. Retry?&quot;&lt;br /&gt;            Choices = vbOKCancel&lt;br /&gt;&lt;br /&gt;         Case Else:   &#39;An error other than 68, 75 or 76 has occurred&lt;br /&gt;&lt;br /&gt;            ErrMsg = &quot;An unrecognized error has occurred ( &quot; &amp;amp; _&lt;br /&gt;               Error(Err) &amp;amp; &quot; ). The macro will end.&quot;&lt;br /&gt;            MsgBox ErrMsg, vbOKOnly&lt;br /&gt;            ReturnValue = Err_Exit&lt;br /&gt;            Exit Sub&lt;br /&gt;&lt;br /&gt;      End Select&lt;br /&gt;&lt;br /&gt;      &#39; Display the error message.&lt;br /&gt;      Result = MsgBox(ErrMsg, Choices)&lt;br /&gt;&lt;br /&gt;      &#39; Determine the ReturnValue based on the user&#39;s choice from MsgBox.&lt;br /&gt;      If Result = vbOK Then&lt;br /&gt;         ReturnValue = Err_Resume&lt;br /&gt;      Else&lt;br /&gt;         ReturnValue = Err_Exit&lt;br /&gt;      End If&lt;br /&gt;&lt;br /&gt;   End Sub&lt;br /&gt;    &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;This next macro demonstrates how you could use the ErrorHandling procedure when an error is encountered:&lt;div class=&quot;kb_codebody&quot;&gt;&lt;div class=&quot;kb_codecontent&quot;&gt;&lt;code&gt;&lt;pre class=&quot;code&quot;&gt;   Sub MyMacro()&lt;br /&gt;&lt;br /&gt;      Dim Action As Integer&lt;br /&gt;&lt;br /&gt;      &#39; Run the Error handler &quot;ErrHandler&quot; when an error occurs.&lt;br /&gt;      On Error GoTo Errhandler&lt;br /&gt;&lt;br /&gt;      ChDrive &quot;B:&quot;&lt;br /&gt;      ChDir &quot;B:\&quot;&lt;br /&gt;      ChDir &quot;B:\XLFiles&quot;&lt;br /&gt;      Workbooks.Open &quot;Book1.xls&quot;&lt;br /&gt;&lt;br /&gt;      &#39; Exit the macro so that the error handler is not executed.&lt;br /&gt;      Exit Sub&lt;br /&gt;&lt;br /&gt;   Errhandler:&lt;br /&gt;&lt;br /&gt;      &#39; Run the ErrorHandling macro to display the error and to&lt;br /&gt;      &#39; return a value for Action which will determine the appropriate&lt;br /&gt;      &#39; action to take (Resume the macro or end the macro)&lt;br /&gt;&lt;br /&gt;      ErrorHandling Err, Action&lt;br /&gt;&lt;br /&gt;      If Action = Err_Exit Then&lt;br /&gt;         Exit Sub&lt;br /&gt;      ElseIf Action = Err_Resume Then&lt;br /&gt;         Resume&lt;br /&gt;      Else&lt;br /&gt;         Resume Next&lt;br /&gt;      End If&lt;br /&gt;&lt;br /&gt;   End Sub&lt;br /&gt;    &lt;/pre&gt;&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/1015052535558556756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/vba-error-handling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/1015052535558556756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/1015052535558556756'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/vba-error-handling.html' title='VBA Error handling'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-7764353448367421861</id><published>2013-02-12T13:26:00.000-08:00</published><updated>2013-02-12T13:26:03.034-08:00</updated><title type='text'>Exit Sub in error handler </title><content type='html'>Exit Sub statement precedes the error handler label. By placing Exit Sub or Exit Function before the error handling routine, you prevent the error-handling code from being run when the macro runs without error. </content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/7764353448367421861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/exit-sub-in-error-handler.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7764353448367421861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/7764353448367421861'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/exit-sub-in-error-handler.html' title='Exit Sub in error handler '/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-2684438176281657700</id><published>2013-02-12T11:09:00.001-08:00</published><updated>2013-02-12T11:09:38.231-08:00</updated><title type='text'>Close workbook with or without saving VBA</title><content type='html'>Sub CloseNoSave()       &#39;Close the workbook without saving it     ThisWorkbook.Close savechanges:=False  End Sub    Sub CloseForceSave()       &#39;Save the workbook, then close it     ThisWorkbook.Close savechanges:=True  End Sub </content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/2684438176281657700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/close-workbook-with-or-without-saving.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2684438176281657700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2684438176281657700'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/close-workbook-with-or-without-saving.html' title='Close workbook with or without saving VBA'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-2628670010170171067</id><published>2013-02-08T15:37:00.000-08:00</published><updated>2013-02-08T15:37:19.663-08:00</updated><title type='text'>Resize Array </title><content type='html'>    Dim n As Integer     n = 1     ReDim Preserve MyArray(1 To n)     MyArray(n) = &quot;StressScenarioReport&quot;     n = n + 1     If AssumptionInput.chkStressLeverage.Value = True Then     ReDim Preserve MyArray(1 To n)     MyArray(n) = &quot;StressScenarioReport_Leverage&quot;     n = n + 1     End If  &#39; MyArray now will contain &quot;StressScenarioReport&quot; and &quot;StressScenarioReport_Leverage&quot;. If remove &quot;Preserve&quot;, this will erase any previous data existing in MyArray</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/2628670010170171067/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/resize-array.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2628670010170171067'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2628670010170171067'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/02/resize-array.html' title='Resize Array '/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-3727165796880153401</id><published>2013-01-15T11:43:00.000-08:00</published><updated>2013-01-15T11:43:55.803-08:00</updated><title type='text'>Open text file and convert containing text to string</title><content type='html'>&lt;br /&gt;&lt;br /&gt;Sub Test()&lt;br /&gt;&amp;nbsp;Dim fname As String&lt;br /&gt;&amp;nbsp; &amp;nbsp; fname = ActiveWorkbook.path &amp;amp; &quot;\Aggregated periods.txt&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; strSql = OpenTextFileToString2(fname)&lt;br /&gt;&#39;replace word in string&lt;br /&gt;&amp;nbsp; &amp;nbsp; strSql = Replace(strSql, &quot;&amp;amp; core_id&quot;, core_id)&lt;br /&gt;&#39;Extract port of string&amp;nbsp;embraced&amp;nbsp;by &quot;Aggregated_periods&quot;&lt;br /&gt;&amp;nbsp; &amp;nbsp; strSql = ExtractPartOfPath(strSql, &quot;Aggregated_periods&quot;)&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Function OpenTextFileToString2(ByVal strFile As String) As String&lt;br /&gt;&amp;nbsp;Dim hFile As Long&lt;br /&gt;&amp;nbsp;hFile = FreeFile&lt;br /&gt;&amp;nbsp;Open strFile For Input As #hFile&lt;br /&gt;&amp;nbsp;OpenTextFileToString2 = Input$(LOF(hFile), hFile)&lt;br /&gt;&amp;nbsp;Close #hFile&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;Function ExtractPartOfPath(path As Variant, DivMark As String) As String&lt;br /&gt;&amp;nbsp; Dim first, second As Integer&lt;br /&gt;&amp;nbsp; first = InStr(path, DivMark)&lt;br /&gt;&amp;nbsp; second = InStr(first + 1, path, DivMark)&lt;br /&gt;&amp;nbsp; ExtractPartOfPath = Mid(path, first + Len(DivMark), second - first - Len(DivMark) - 1)&lt;br /&gt;End Function&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/3727165796880153401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/01/open-text-file-and-convert-containing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3727165796880153401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3727165796880153401'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/01/open-text-file-and-convert-containing.html' title='Open text file and convert containing text to string'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-3054261691363539992</id><published>2013-01-08T08:18:00.002-08:00</published><updated>2013-01-08T08:18:20.777-08:00</updated><title type='text'>Open Embedded file or Object using VBA</title><content type='html'>&lt;br /&gt;Sub ActivateObj()&lt;br /&gt;&#39;// Opens object&lt;br /&gt;Dim oEmbFile As Object&lt;br /&gt;Application.DisplayAlerts = False&lt;br /&gt;&#39;// Either reference the OLEObject by index&lt;br /&gt;&#39;// or by name if you Name the Object&lt;br /&gt;&#39;// Note:&lt;br /&gt;&#39;// Sheets(2) substitute with your Sheet&lt;br /&gt;Set oEmbFile = ThisWorkbook.Sheets(1).OLEObjects(1)&lt;br /&gt;&amp;nbsp; &amp;nbsp; oEmbFile.Verb Verb:=xlPrimary&lt;br /&gt;Set oEmbFile = Nothing&lt;br /&gt;Application.DisplayAlerts = True&lt;br /&gt;End Sub&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/3054261691363539992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/01/open-embedded-file-or-object-using-vba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3054261691363539992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/3054261691363539992'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/01/open-embedded-file-or-object-using-vba.html' title='Open Embedded file or Object using VBA'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-8305473810385090428</id><published>2013-01-08T08:01:00.002-08:00</published><updated>2013-01-08T08:01:39.227-08:00</updated><title type='text'>Getting text file into a VBA string variable </title><content type='html'>&lt;br /&gt;Sub Tester4()&lt;br /&gt;&amp;nbsp;Dim fname As String&lt;br /&gt;&amp;nbsp;Dim sVal As String&lt;br /&gt;&amp;nbsp;fname = &quot;C:\test\test.txt&quot;&lt;br /&gt;&amp;nbsp;sVal = OpenTextFileToString2(fname)&lt;br /&gt;&amp;nbsp;Debug.Print sVal&lt;br /&gt;&amp;nbsp;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Function OpenTextFileToString2(ByVal strFile As String) As String&lt;br /&gt;&amp;nbsp;Dim hFile As Long&lt;br /&gt;&amp;nbsp;hFile = FreeFile&lt;br /&gt;&amp;nbsp;Open strFile For Input As #hFile&lt;br /&gt;&amp;nbsp;OpenTextFileToString2 = Input$(LOF(hFile), hFile)&lt;br /&gt;&amp;nbsp;Close #hFile&lt;br /&gt;&amp;nbsp;End Function&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/8305473810385090428/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/01/getting-text-file-into-vba-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/8305473810385090428'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/8305473810385090428'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2013/01/getting-text-file-into-vba-string.html' title='Getting text file into a VBA string variable '/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5263091766606263260.post-2296107309554461207</id><published>2012-12-10T11:28:00.003-08:00</published><updated>2012-12-10T11:28:49.501-08:00</updated><title type='text'>VBA Null value</title><content type='html'>VBA data type date and number cannot hold Null value, but database can. Try to set data type to variant in VBA instead.</content><link rel='replies' type='application/atom+xml' href='http://rmlpanelexcel.blogspot.com/feeds/2296107309554461207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rmlpanelexcel.blogspot.com/2012/12/vba-null-value.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2296107309554461207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5263091766606263260/posts/default/2296107309554461207'/><link rel='alternate' type='text/html' href='http://rmlpanelexcel.blogspot.com/2012/12/vba-null-value.html' title='VBA Null value'/><author><name>RML Panel</name><uri>http://www.blogger.com/profile/07925140693385949898</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>