<?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-3967404005362840312</id><updated>2024-09-01T22:57:12.734+05:30</updated><category term="Autofilter error handling procedure"/><category term="CMS Avaya Script"/><category term="Excel Borders"/><category term="Excel Macro"/><category term="Find last row or last column"/><category term="How to Create Excel Addin"/><category term="How to Rename files in Directory"/><category term="How to Speedup the macro"/><category term="How to find the number of occurance of a value using Excel VBA"/><category term="On Error GoTo 0"/><category term="Send mails with attachments and Customized mail body"/><category term="Subtract Dates"/><category term="Using IF Conditon - Excel Macro"/><category term="del.ico.us"/><category term="reduce the excel file size"/><category term="website to learn basics of Excel macro"/><title type='text'>Excel Macro Man</title><subtitle type='html'>Welcome to this blog... here you get some excellent short cuts for some difficult excel VBA programming logic.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-8647584860780752575</id><published>2010-12-11T21:41:00.000+05:30</published><updated>2010-12-11T21:41:32.142+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="How to Create Excel Addin"/><title type='text'>How to Create Addin</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Creating  Add-ins in Excel&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;After much analysis I created my own steps to Create Excel Addin&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;b&gt;Follow the below basic steps to create Addin&lt;/b&gt; -&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Always  use Workbook or Activeworkbook – don’t use Thisworkbook in coding &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;The Final Addin Should not have any sheets like – Raw file or data sheet&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Have  a blank Sheet and all the coding should refer to Workbook Object or Activeworkbook method&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;The Main Subroutine should be Public Sub Sub_name&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;All  Functions should be Public Function FnName &lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;All the  modules should have specific names- select the module in Project Explorer View &amp;amp; Press F4 (properties) now enter a specific name for the module&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Now select the VBA Project in Project Explorer view &amp;amp; Press F4 (Properties) and enter a specific name for the project. This step is required because if you leave the default name for the project it would be named as &quot;VBAProject&quot; and MS Excel would not allow you to enter duplicate addins with same name - &quot;VBAProject&quot;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;You  can use Public variables in Add-ins&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Now save  the file as .XLA (2003 version) or .xlam (2007 version) [ Note you can save the file in any location - just remember where you have saved the addin file)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Now your Addin has been created &lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;b&gt;So now the addin has been created, how to include the same in your project&lt;/b&gt; -&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Now  goto the main Excel file where you have to include the addin and goto the Visual Basic Editor (press Alt-F11)&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Go  to Tools &amp;gt; References &amp;gt; Click on Browse and select the required .xla or  .xlam file&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;At this stage if you are getting any errors the below are the possible reasons -&lt;/span&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;The &lt;span style=&quot;background-color: #fff2cc; color: red;&quot;&gt;Function Name or Module name or Project name or Sub routine name or Variable name&lt;/span&gt; would have already been there in the current module as well. Check for duplicated Sub or Function or Variable name and correct it&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;If the current Excel file already has an Addin and you get an error while including a new Addin the check for the same issues - Function Name, Sub routine Name, Project Name, Variable names etc&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;border-color: -moz-use-text-color -moz-use-text-color windowtext; border-style: none none solid; border-width: medium medium 1pt; padding: 0in 0in 1pt;&quot;&gt; &lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;b&gt;Now that you have included the Addin, how to make it working&lt;/b&gt; - &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;In the current Excel sheet - goto the Visual Basic Window and double click on &quot;ThisWorkbook&quot; and enter the below code - &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&#39;&#39;&#39;&#39; Below Code Courtesy &lt;/span&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&lt;a href=&quot;http://www.blogger.com/redir.aspx?C=665dddb044fa40e3b936a644584bda2c&amp;amp;URL=http%3a%2f%2fwww.brainbell.com%2ftutorials%2fms-office%2fexcel%2fDistribute_Macros.htm&quot; target=&quot;_blank&quot;&gt;http://www.brainbell.com/tutorials/ms-office/excel/Distribute_Macros.htm&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Option  Explicit&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Dim  cControl As CommandBarButton&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Private  Sub Workbook_AddinInstall()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;On  Error Resume Next&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Call  AddMenus&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;On  Error GoTo 0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;End  Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Private  Sub Workbook_AddinUninstall()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;On  Error Resume Next &#39;In case it has already gone.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Call  DeleteMenu&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;text-indent: 0.5in;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;On  Error GoTo 0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;End  Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Sub  AddMenus()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Dim  cMenu1 As CommandBarControl&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Dim  cbMainMenuBar As CommandBar&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Dim  iHelpMenu As Integer&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Dim  cbcCutomMenu As CommandBarControl&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&#39;=========&amp;nbsp; use the below code to create Addin Drop down button&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;(1)Delete any existing one. We must use On Error Resume next _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;in case it does not exist.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  On Error Resume Next&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Application.CommandBars(&quot;Worksheet Menu Bar&quot;).Controls(&quot;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Drop down Name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&quot;).Delete&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;(2)Set a CommandBar variable to the worksheet menu bar&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Set cbMainMenuBar = _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Application.CommandBars(&quot;Worksheet Menu Bar&quot;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;(3)Return the index number of the Help menu. We can then use _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  this to place a custom menu before it.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  iHelpMenu = _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  cbMainMenuBar.Controls(&quot;Help&quot;).Index&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;(4)Add a control to the &quot;Worksheet Menu Bar&quot; before Help.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;Set a CommandBarControl variable to it&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Set cbcCutomMenu = _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  cbMainMenuBar.Controls.Add(Type:=msoControlPopup, _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Before:=iHelpMenu)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;(5)Give the control a caption&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  cbcCutomMenu.Caption = &quot;&amp;amp;Drop down Name&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;(6)Working with our new control, add a sub control and _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;&amp;nbsp; give it a caption and tell it which macro to run (OnAction).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  With cbcCutomMenu.Controls.Add(Type:=msoControlButton)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  .Caption = &quot;DD List 1&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  .OnAction = &quot;DD list1_macro&quot;&amp;nbsp; &#39;&#39;&#39; this macro name should be the same in the addin&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  End With&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;(6a)Add another sub control and give it a caption _&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;and tell it which macro to run (OnAction)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  With cbcCutomMenu.Controls.Add(Type:=msoControlButton)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  .Caption = &quot;DD List 2&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  .OnAction = &quot;DD List2_macro&quot;&amp;nbsp; &#39;&#39;&#39; this macro name should be the same in the Addin&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  End With&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;Repeat step &quot;6a&quot; for each menu item you want to add.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;Add another menu that will lead off to another menu&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;Set a CommandBarControl variable to it&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&#39;======== use the below code just to create just one addin button &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39; Set cbcCutomMenu = cbcCutomMenu.Controls.Add(Type:=msoControlPopup)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39; Give the control a caption&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39; cbcCutomMenu.Caption = &quot;Ne&amp;amp;xt Menu&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;Add a control to the sub menu just created above&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;&amp;nbsp;&amp;nbsp;&amp;nbsp; With cbcCutomMenu.Controls.Add(Type:=msoControlButton)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Caption = &quot;&amp;amp;Charts&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .FaceId = 420&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .OnAction = &quot;MyMacro2&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp; On  Error GoTo 0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;End  Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Sub  DeleteMenu()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;  On Error Resume Next&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Application.CommandBars(&quot;Worksheet Menu Bar&quot;).Controls(&quot;&amp;amp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;Drop down Name&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&quot;).Delete&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Application.CommandBars(&quot;Worksheet Menu Bar&quot;).Controls(&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;DD List 1&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&quot;).Delete&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Application.CommandBars(&quot;Worksheet Menu Bar&quot;).Controls(&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;DD List 2&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&quot;).Delete&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;&amp;nbsp;&amp;nbsp;  On Error GoTo 0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;;&quot;&gt;End  Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Now that the code is ready how to execute it !!&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Create a Console Sheet and Add Two Command Buttons-&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;1st Button - Name &quot;Delete Addin&quot; - Call the macro &quot;DeleteMenu()&quot;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;2nd Button - Name &quot;Include Addin&quot; - Call the macro &quot;AddMenus()&quot;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;b&gt;Procedure to use the Addin&lt;/b&gt; &lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;When you first click on Include Addin Button, Excel would create a Drop down / buttons in &lt;b&gt;Addin Tab&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;When you click on Delete Addin Button, Excel would remove the Drop down / buttons in &lt;b&gt;Addin Tab &lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;So that you have created Addin, Include the Addin, and created buttons in Addin&amp;nbsp; - how to execute the Addin&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Its just simple now, you just got to click on the buttons created in the Addin Tab to run the appropriate macro&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;Voila… it works !!!&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;border: medium none; padding: 0in;&quot;&gt;&lt;span style=&quot;color: #0a1792; font-family: &#39;Tahoma&#39;,&#39;sans-serif&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/8647584860780752575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/how-to-create-addin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8647584860780752575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8647584860780752575'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/how-to-create-addin.html' title='How to Create Addin'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-57257745892089923</id><published>2010-12-11T19:48:00.000+05:30</published><updated>2010-12-11T19:48:27.702+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Send mails with attachments and Customized mail body"/><title type='text'>Customized Mail Merge - Excel VBA</title><content type='html'>&lt;div style=&quot;background-color: #fff2cc; color: orange; font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;background-color: #b4a7d6;&quot;&gt;&lt;span style=&quot;color: #741b47;&quot;&gt;Excel Macro - Mail Merge&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Ever wondered how to send multiple attachments to a set of &#39;To&#39; list and &#39;CC&#39; list with different Mail body text !!&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Well here is the solution to send email attachments with customized To, CC&amp;nbsp; &amp;amp; Mail Body text&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Open an Excel Sheet and enter the Attachment details in Col B [path and file name]; To list in Col C [if there are multiple email ids then separate them with Semi-Colon &#39;;&#39;] ; Mail Body contents in Col D&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;The line which says .send if activated, all mails would be sent automatically.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;Function Email_Attachment()&lt;br /&gt;
&lt;br /&gt;
Dim olApp As Outlook.Application&lt;br /&gt;
Dim olMail As MailItem&lt;br /&gt;
Dim WBMl As Workbook&lt;br /&gt;
&lt;br /&gt;
Set WBMl = ActiveWorkbook&lt;br /&gt;
R = WBMl.Sheets(1).Range(&quot;B65536&quot;).End(xlUp).Row&lt;br /&gt;
S = WBMl.Sheets(1).Range(&quot;B1&quot;).End(xlDown).Row&lt;br /&gt;
&lt;br /&gt;
For a = S To R&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set olApp = CreateObject(&quot;Outlook.Application&quot;)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set olMail = olApp.CreateItem(olMailItem)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; With olMail&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .To = Cells(a, 3).Text&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .CC = Cells(a, 4).Text&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;.SentOnBehalfOfName = &quot;&quot;&quot;xyz&quot;&quot; &quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Subject = &quot;Resources&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Body = Cells(a, 5).Text&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Attachments.Add Cells(a, 2).Text&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; un-comment the below option to send mails automatically&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;.send&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; the below option is give so that the mails are draft mode.&lt;/span&gt;&lt;br style=&quot;font-family: Verdana,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .display&lt;/span&gt;&lt;br style=&quot;font-family: Verdana,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;/span&gt;&lt;br style=&quot;font-family: Verdana,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set olMail = Nothing&lt;/span&gt;&lt;br style=&quot;font-family: Verdana,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set olApp = Nothing&lt;/span&gt;&lt;br style=&quot;font-family: Verdana,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;Next a&lt;/span&gt;&lt;br style=&quot;font-family: Verdana,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: Verdana,sans-serif;&quot;&gt;End Function&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/57257745892089923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/customized-mail-merge-excel-vba.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/57257745892089923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/57257745892089923'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/customized-mail-merge-excel-vba.html' title='Customized Mail Merge - Excel VBA'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-3169089599676168626</id><published>2010-12-05T23:50:00.000+05:30</published><updated>2010-12-05T23:50:38.548+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="On Error GoTo 0"/><title type='text'>Error Handling - Find Method</title><content type='html'>How to handle an error when the value which you are searching is not available in Excel sheet.&lt;br /&gt;
&lt;br /&gt;
Sub Err_Hnd()&lt;br /&gt;
&lt;br /&gt;
Dim M_Rng as Range&lt;br /&gt;
Sheets(&quot;My Sheet&quot;).Select&lt;br /&gt;
On Error Resume Next&lt;br /&gt;
Set M_Rng = Sheets(&quot;My Sheet&quot;).Columns(1).Find(What:=Test_PID, after:=Cells(1, 1), LookIn:=xlValues,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LookAt:=xlPart, SearchOrder:=xlByRows, _&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchdirection:=xlNext, MatchCase:=False)&lt;br /&gt;
On Error GoTo 0&lt;br /&gt;
&lt;br /&gt;
If M_Rng Is Nothing Then GoTo Err_H:&lt;br /&gt;
&#39;&#39;&#39;&#39; if M_Rng has returned any value then your code execution starts from here&lt;br /&gt;
Err_H:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;&#39;&#39;&#39; based on the error what has to be done&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;&#39;&#39; exit sub&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Below are the Error Handler Options in Excel VBA-&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;   &lt;b&gt;On Error GoTo &lt;line&gt;&lt;/line&gt;&lt;/b&gt;&lt;br /&gt;
Enables the error-handling routine that starts at &lt;line&gt;, which is    any line label or line number. The specified line must be in the    same procedure as the On Error statement.&lt;/line&gt;&lt;/li&gt;
&lt;li&gt;    &lt;b&gt;On Error Resume Next&lt;/b&gt;&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;   &lt;b&gt;On Error GoTo 0&lt;/b&gt;&lt;br /&gt;
Disables any enabled error handler in the current procedure.&lt;/li&gt;
&lt;/ul&gt;In the above example what we are doing is allowing the execution of the macro to proceed if an error occurs (i.e, using the &lt;b&gt;On Error Resume Next&lt;/b&gt; )&lt;br /&gt;
Subsequently we are disabled the error handler using &lt;b&gt;On Error GoTo&amp;nbsp; 0&lt;/b&gt;&lt;br /&gt;
Now we are checking the Range variable if it contains Nothing, if yes then we take the code execution to the error handler label, otherwise the execution proceeds as usual.</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/3169089599676168626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/error-handling-find-method.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/3169089599676168626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/3169089599676168626'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/error-handling-find-method.html' title='Error Handling - Find Method'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-7179134274546104795</id><published>2010-12-05T23:33:00.001+05:30</published><updated>2010-12-05T23:35:26.415+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="How to find the number of occurance of a value using Excel VBA"/><title type='text'>Using Find Method in Code</title><content type='html'>Sometimes in Excel Macro coding, when you are required to find any specific cell value and execute the list of codes. It becomes extremely time taking when you loop through all cells in the excel column.The simple solution is to use the Find method in Excel Code.&lt;br /&gt;
&lt;br /&gt;
Set rFound_Cell=Columns(2).Find(What:=&quot;$$&quot;, after:=Cells(1,1), LookIn:=xlValues, _&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; LookAt:=xlPart, SearchOrder:=xlByRows, _&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; searchdirection:=xlNext, MatchCase:=False)&lt;br /&gt;
&lt;br /&gt;
SRow=rFound_Cell.Row&lt;br /&gt;
&lt;br /&gt;
What if there are multiple matching cells and you got to loop through each time the match occurs -&lt;br /&gt;
Use the Countif Function to establish the number of occurrence of string or value in the sheet and then loop it.&lt;br /&gt;
&lt;br /&gt;
Dim rFound_Cell As Range&lt;br /&gt;
Set rFound_Cell = Range(&quot;B1&quot;)&lt;br /&gt;
Sheets(&quot;Sheet1&quot;).Select&lt;br /&gt;
For i = 1 To WorksheetFunction.CountIf(Columns(2), &quot;($$$)&quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set rFound_Cell = Columns(2).Find(What:=&quot;($$$)&quot;, after:=rFound_Cell, LookIn:=xlValues, _&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LookAt:=xlPart, SearchOrder:=xlByRows, _&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchdirection:=xlNext, MatchCase:=False)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SRow = rFound_Cell.Row&lt;br /&gt;
&lt;br /&gt;
Next i</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/7179134274546104795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/using-find-method-in-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7179134274546104795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7179134274546104795'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/using-find-method-in-code.html' title='Using Find Method in Code'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-5820379671175127153</id><published>2010-12-05T22:51:00.000+05:30</published><updated>2010-12-05T22:51:09.338+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="How to Speedup the macro"/><title type='text'>How to Speed-up the macro execution</title><content type='html'>Sub Main_Prg()&lt;br /&gt;
Speedup_Macro True&lt;br /&gt;
&#39;&#39;&#39;&#39; Your Code&lt;br /&gt;
&#39;&#39;&#39;&lt;br /&gt;
&#39;&#39;&#39;end of code&lt;br /&gt;
Speedup_Macro False&lt;br /&gt;
End Sub&lt;br /&gt;
&lt;br /&gt;
Function Speedup_Macro(Chk As Boolean)&lt;br /&gt;
If Chk = True Then&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.DisplayAlerts = False&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.ScreenUpdating = False&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.DisplayStatusBar = True&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.StatusBar = &quot;Macro is working....pls wait &quot;&lt;br /&gt;
Else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.DisplayAlerts = True&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.ScreenUpdating = True&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.DisplayStatusBar = True&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Application.StatusBar = &quot;&quot;&lt;br /&gt;
End If&lt;br /&gt;
End Function&lt;br /&gt;
&lt;br /&gt;
Description -&lt;br /&gt;
&lt;b&gt;Application.DisplayAlerts&lt;/b&gt; &lt;br /&gt;
&lt;br /&gt;
The default value is &lt;b class=&quot;bterm&quot;&gt;True&lt;/b&gt;. Set this property to &lt;b class=&quot;bterm&quot;&gt;False&lt;/b&gt;  if you don&#39;t want to be disturbed by prompts and alert messages while a  macro is running; any time a message requires a response, Microsoft  Excel chooses the default response.&lt;br /&gt;
When using the &lt;b class=&quot;bterm&quot;&gt;SaveAs&lt;/b&gt; method for workbooks to  overwrite an existing file, the &#39;Overwrite&#39; alert has a default of &#39;No&#39;,  while the &#39;Yes&#39; response is selected by Excel when the &lt;b class=&quot;bterm&quot;&gt;DisplayAlerts&lt;/b&gt; property is set equal to &lt;b class=&quot;bterm&quot;&gt;False&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Application.ScreenUpdating&lt;/b&gt; &lt;br /&gt;
Turn screen updating off to speed up your macro code. You won&#39;t be able to see what the macro is doing, but it will run faster.&lt;br /&gt;
Remember to set the &lt;strong&gt;ScreenUpdating&lt;/strong&gt; property back to &lt;strong&gt;True&lt;/strong&gt; when your macro ends.</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/5820379671175127153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/how-to-speed-up-macro-execution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5820379671175127153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5820379671175127153'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/12/how-to-speed-up-macro-execution.html' title='How to Speed-up the macro execution'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-4602161318385065195</id><published>2010-09-12T00:39:00.002+05:30</published><updated>2010-09-12T00:46:09.391+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="reduce the excel file size"/><title type='text'>Procedure to reduce the size of Excel files</title><content type='html'>&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Just wondering how to reduce the size of Excel files, frustrated with ever increasing excel file size without any idea, tried creating new copies still of no use. Well even I was a victim of this ever increasing file size in excel. After a lot of trial and error method and some technical analysis, I tried to put the steps in order so that it would be helpful for everyone.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Follow the below steps to reduce the size of excel files -&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;ol start=&quot;1&quot; style=&quot;margin-top: 0in;&quot; type=&quot;1&quot;&gt;&lt;li class=&quot;MsoNormal&quot; style=&quot;color: red;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Before starting the      procedure take a backup of the file&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Unhide      all sheets&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Select all unused / blank columns and go to &lt;b&gt;Edit&amp;gt;Clear&amp;gt;All&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Select      all unused / blank rows and go to &lt;b&gt;Edit&amp;gt;Clear&amp;gt;All&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Repeat the steps 2 &amp;amp; 3      for all the sheets&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Save the file and close it      and now check the file size, it would have reduce considerably.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% yellow; font-family: Tahoma; font-size: 10pt;&quot;&gt;The above steps work, believe me I have tested the same and after following the steps the file size reduced from 90 MB straight down to 5 MB !!!&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 10pt;&quot;&gt;Also some excel sheets would have a very small scroll bar irrespective of the contents of the sheet&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
&lt;b&gt;Steps to correct the scrollbar issue&lt;/b&gt; –  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;Find the last used row and then &lt;b&gt;select all the cells below this till end of the column&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;b&gt;Select Edit &amp;gt; Delete and select Entire Row&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;Now Save the excel file and then reopen it&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;Now the scrollbar would turn out to be of normal length&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 11pt;&quot;&gt;Hope this works and the file size would be reduced thereby saving time to open the file and also save the disk space.&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 9pt;&quot;&gt;Thanks for reading this article &lt;/span&gt;&lt;span style=&quot;font-family: Wingdings; font-size: 9pt;&quot;&gt;J&lt;/span&gt;&lt;span style=&quot;font-family: Tahoma; font-size: 9pt;&quot;&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/4602161318385065195/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/09/procedure-to-reduce-size-of-excel-files.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/4602161318385065195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/4602161318385065195'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/09/procedure-to-reduce-size-of-excel-files.html' title='Procedure to reduce the size of Excel files'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-7056791523328005457</id><published>2010-06-26T01:44:00.000+05:30</published><updated>2010-06-26T01:44:15.660+05:30</updated><title type='text'>Excel Functions Library</title><content type='html'>&lt;a href=&quot;http://www.scribd.com/doc/33559602/Excel-Functions-Dictionary&quot;&gt;Excel Functions Library&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/7056791523328005457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/excel-functions-library.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7056791523328005457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7056791523328005457'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/excel-functions-library.html' title='Excel Functions Library'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-2202567055125495653</id><published>2010-06-26T01:38:00.000+05:30</published><updated>2010-06-26T01:38:14.654+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="website to learn basics of Excel macro"/><title type='text'>Good Website to understand basics of Excel Macro - 2</title><content type='html'>&lt;span style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;http://www.tushar-mehta.com/excel/vba/beyond_the_macro_recorder/&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/2202567055125495653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/good-website-to-understand-basics-of_26.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/2202567055125495653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/2202567055125495653'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/good-website-to-understand-basics-of_26.html' title='Good Website to understand basics of Excel Macro - 2'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-8735577544791176374</id><published>2010-06-26T01:22:00.000+05:30</published><updated>2010-06-26T01:22:57.209+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Autofilter error handling procedure"/><title type='text'>Autofilter error - Autofilter Method of Range class failed</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;How to handle error in AutoFilter Method while using Excel Macros -&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&lt;b&gt;Error &lt;/b&gt;- &quot;autofilter method of  range class failed&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Reasons - &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;because the rows might  be blank &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;It&#39;s caused because  your data is not laid out for AutoFilter. To use AutoFilter the data has to be  in a table layout with a Header, with no empty rows or columns.  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Solution-  &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;select the complete  range of values and then do selection.autofilter&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/8735577544791176374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/autofilter-error-autofilter-method-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8735577544791176374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8735577544791176374'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/autofilter-error-autofilter-method-of.html' title='Autofilter error - Autofilter Method of Range class failed'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-8721587647644412326</id><published>2010-06-26T01:18:00.000+05:30</published><updated>2010-06-26T01:18:25.163+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Subtract Dates"/><title type='text'>How to Subtract the given no.of days from today</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Sub Sub_dates()&lt;br /&gt;
&lt;br /&gt;
x = InputBox(&quot;Enter the no.of days to be subtracted from  today&#39;s date&quot;)&lt;br /&gt;
y = DateAdd(&quot;d&quot;, -x, Now)&lt;br /&gt;
z = Mid(y, 1, InStr(1, y, &quot; &quot;) -  1)&lt;br /&gt;
&lt;br /&gt;
MsgBox z&lt;br /&gt;
End Sub&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/8721587647644412326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/how-to-subtract-given-noof-days-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8721587647644412326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8721587647644412326'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/how-to-subtract-given-noof-days-from.html' title='How to Subtract the given no.of days from today'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-5326125723107817516</id><published>2010-06-26T01:15:00.000+05:30</published><updated>2010-06-26T01:15:53.394+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="How to Rename files in Directory"/><title type='text'>How to rename file in a directory</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sub  rename_file()&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Dim OldName,  NewName&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;clearfilepath&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;SearchFile&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Range(&quot;A65536&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;ro1 =  Selection.End(xlUp).Row&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;For i = 2 To  ro1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OldName = Cells(i,  1).Value &#39;&quot;D:\Documents and Settings\XXXXXX\Devlopment\2010-3-30\chr0101.591&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewName = OldName  &amp;amp; &quot;.csv&quot; &#39; Define file names.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name OldName As  NewName &#39; Rename file.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Next  i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;MsgBox &quot;Its done  !!&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End  Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Function  SearchFile()&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Set fs =  Application.FileSearch&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;With  fs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&#39;‘this code  automatically searches for files in desktop – Source File  folder&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .LookIn =  Environ(&quot;userprofile&quot;) &amp;amp; Application.PathSeparator &amp;amp; &quot;Desktop&quot; &amp;amp;  Application.PathSeparator &amp;amp; &quot;Source File&quot; &amp;amp;  Application.PathSeparator&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .FileType =  msoFileTypeAllFiles&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If .Execute &amp;gt; 0  Then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;For i = 1 To  .FoundFiles.Count&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&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; Range(&quot;A&quot;  &amp;amp; (i + 1)).Value = .FoundFiles(i)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next  i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;MsgBox &quot;There  were no Binder files found.&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End  If&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End  With&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End  Function&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Function  clearfilepath()&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Range(&quot;A2:A65536&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Selection.ClearContents&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End  Function&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/5326125723107817516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/how-to-rename-file-in-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5326125723107817516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5326125723107817516'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/how-to-rename-file-in-directory.html' title='How to rename file in a directory'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-7268997542108996083</id><published>2010-06-26T01:12:00.002+05:30</published><updated>2010-06-26T01:12:56.925+05:30</updated><title type='text'>Good Website to understand basics of Excel Macro</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;I just came across this website and seems to be really good to understand macro  from basics.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/redir.aspx?C=2e98d411dd4e463faa0cda61fc6ce838&amp;amp;URL=http%3a%2f%2fwww.anthony-vba.kefra.com%2fvba%2fvbabasic1.htm&quot; target=&quot;_blank&quot;&gt;http://www.anthony-vba.kefra.com/vba/vbabasic1.htm&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/7268997542108996083/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/good-website-to-understand-basics-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7268997542108996083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7268997542108996083'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/good-website-to-understand-basics-of.html' title='Good Website to understand basics of Excel Macro'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-6309676108725273687</id><published>2010-06-26T01:11:00.002+05:30</published><updated>2010-06-26T01:11:53.581+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel Borders"/><title type='text'>Draw border lines around cells with common values</title><content type='html'>How to draw borders around cells with common values&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;Sub  Draw_border_for_common_items_in_row()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;Sheets(&quot;Top  CTDs&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;LC1 =  ActiveSheet.UsedRange.SpecialCells(xlLastCell).Column&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;LR1 =  ActiveSheet.UsedRange.SpecialCells(xlLastCell).Row&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;For i = 1 To  LC1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;temp = Cells(2,  i).Value&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;ro =  2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For j = 2 To  LR1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Cells(j,  i).Value &amp;lt;&amp;gt; temp Then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Range(Cells(ro, i), Cells(j - 1, i)).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Selection.BorderAround Weight:=xlThin&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ro =  j&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; temp =  Cells(j, i).Value&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End  If&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next  j&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;Next  i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Tahoma; font-size: 10pt;&quot;&gt;End  Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/6309676108725273687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/draw-border-lines-around-cells-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/6309676108725273687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/6309676108725273687'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/draw-border-lines-around-cells-with.html' title='Draw border lines around cells with common values'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-5747454354192706252</id><published>2010-06-26T01:09:00.000+05:30</published><updated>2010-06-26T01:09:15.962+05:30</updated><title type='text'>Collating the CMS Avaya Raw Dump into consolidated raw data</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;pre style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Sub test()
Dim myDir As String, fn As String
myDir = &quot;W:\XXXXXXXXXX\2010\Raw dump - avaya script\&quot;
fn = Dir(myDir &amp;amp; &quot;*.xls&quot;)
Do While fn &amp;lt;&amp;gt; &quot;&quot;
    If fn &amp;lt;&amp;gt; ThisWorkbook.Name Then
        With Workbooks.Open(myDir &amp;amp; fn)
            With .Sheets(1).Range(&quot;A1:IV200&quot;)
                ThisWorkbook.Sheets(1).Range(&quot;a&quot; &amp;amp; Rows.Count).End(xlUp)(4) _
                .Resize(.Rows.Count, .Columns.Count).Value = .Value
            End With
            .Close False
        End With
    End If
    fn = Dir
Loop
Rows(&quot;1:3&quot;).Select
Selection.Delete shift:=xlUp
Range(&quot;a1&quot;).Select
End Sub&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/5747454354192706252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/collating-cms-avaya-raw-dump-into.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5747454354192706252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5747454354192706252'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/collating-cms-avaya-raw-dump-into.html' title='Collating the CMS Avaya Raw Dump into consolidated raw data'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-4939466879957469181</id><published>2010-06-26T01:06:00.000+05:30</published><updated>2010-06-26T01:06:26.928+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CMS Avaya Script"/><title type='text'>How to edit CMS Avaya Script</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Open the required CMS Avaya Script and Save the Script and then do the below modifications -&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;comment the line&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;b=Rep.Run&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;and add the below line&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;b=Rep.Exportdata(&quot;\\path\Raw dump - avaya script\255.xls&quot;,9,0,false,true,true)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;also if you wanna make the script more dynamic then add the below lines&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt; Date1 = Inputbox (&quot;Please enter the Start date of the reports you wish to see in the format mm/dd/yyyy&quot;)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Time1 =  Inputbox (&quot;Please enter the Start Time of the reports you wish to see in the format hh:mm&quot;)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Date2 = Inputbox (&quot;Please enter the END date of the reports you wish to see in the format mm/dd/yyyy&quot;)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Time2 =  Inputbox (&quot;Please enter the END Time of the reports you wish to see in the format hh:mm&quot;)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;and now modify the Rep property section as shown below -&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;        Rep.SetProperty &quot;Splits/Skills&quot;,&quot;255&quot; &#39;Skill number&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;         Rep.SetProperty &quot;Start Date&quot;,Date1  &#39;-1 - Yday&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Rep.SetProperty &quot;Start Time&quot;,Time1  &#39;&quot;14:30&quot;&amp;nbsp; - start time&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Rep.SetProperty &quot;Stop Date&quot;,Date2   &#39;0 -today&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Rep.SetProperty &quot;Stop Time&quot;,Time2 &#39;04:00 - end time&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/4939466879957469181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/how-to-edit-cms-avaya-script.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/4939466879957469181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/4939466879957469181'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/how-to-edit-cms-avaya-script.html' title='How to edit CMS Avaya Script'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-5705188682128434808</id><published>2010-06-26T00:59:00.003+05:30</published><updated>2010-06-26T00:59:59.336+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Find last row or last column"/><title type='text'>Finding the last row or column</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;How to find the last row or last column in any excel sheet&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #333399; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #333399; font-size: 10pt; font-weight: bold;&quot;&gt;LR  = ActiveSheet.UsedRange.SpecialCells(xlLastCell).Row&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #333399; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #333399; font-size: 10pt; font-weight: bold;&quot;&gt;LC  = ActiveSheet.UsedRange.SpecialCells(xlLastCell).Column&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #333399; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #333399; font-size: 10pt; font-weight: bold;&quot;&gt;or&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #333399; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #333399; font-size: 10pt; font-weight: bold;&quot;&gt;LR= range(&quot;A65536&quot;).end(xlup).row&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #333399; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #333399; font-size: 10pt; font-weight: bold;&quot;&gt;Lc=range(&quot;IV1&quot;).end(xltoleft).column &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #333399; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: #333399; font-size: 10pt; font-weight: bold;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/5705188682128434808/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/finding-last-row-or-column.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5705188682128434808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/5705188682128434808'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/06/finding-last-row-or-column.html' title='Finding the last row or column'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-1002223532998260528</id><published>2010-04-04T00:17:00.002+05:30</published><updated>2010-04-04T00:22:58.162+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="del.ico.us"/><title type='text'>Excel Macro Man: How to rename file in a directory</title><content type='html'>&lt;b&gt;&lt;a href=&quot;http://excelmacroman.blogspot.com/2010/04/how-to-rename-file-in-directory.html&quot;&gt;Excel Macro&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Sub  rename_file()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Dim OldName,  NewName&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;clearfilepath&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;SearchFile&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Range(&quot;A65536&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;ro1 =  Selection.End(xlUp).Row&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;For i = 2 To  ro1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OldName =  Cells(i, 1).Value &#39;&quot;D:\Documents and  Settings\xxxx\Desktop\2010-3-30\chr0101.591&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewName =  OldName &amp;amp; &quot;.csv&quot; &#39; Define file names.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name  OldName As NewName &#39; Rename file.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Next i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;MsgBox &quot;Its  done !!&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;End Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Function  SearchFile()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Set fs =  Application.FileSearch&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;With fs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&#39;‘this code  automatically searches for files in desktop – Source File folder&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .LookIn =  Environ(&quot;userprofile&quot;) &amp;amp; Application.PathSeparator &amp;amp; &quot;Desktop&quot;  &amp;amp; Application.PathSeparator &amp;amp; &quot;Source File&quot; &amp;amp;  Application.PathSeparator&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .FileType =  msoFileTypeAllFiles&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If  .Execute &amp;gt; 0 Then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;For i =  1 To .FoundFiles.Count&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&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;  Range(&quot;A&quot; &amp;amp; (i + 1)).Value = .FoundFiles(i)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;MsgBox &quot;There were no Binder files found.&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;End With&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;End Function&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Function  clearfilepath()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Range(&quot;A2:A65536&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;Selection.ClearContents&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;End Function&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/1002223532998260528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/04/excel-macro-man-how-to-rename-file-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/1002223532998260528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/1002223532998260528'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/04/excel-macro-man-how-to-rename-file-in.html' title='Excel Macro Man: How to rename file in a directory'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-8300630711179603</id><published>2010-04-04T00:01:00.001+05:30</published><updated>2010-04-04T00:17:03.813+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel Macro"/><title type='text'>Subtract the given no.of days from today</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Enter the no.of days to be subtracted from today&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;for eg:- if Now returns 3rd April 2010&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;and you enter 3 ... then it would return 31st March 2010&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Sub Sub_dates()&lt;br /&gt;
&lt;br /&gt;
x = InputBox(&quot;Enter the no.of days to be subtracted frm today&quot;)&lt;br /&gt;
y = DateAdd(&quot;d&quot;, -x, Now)&lt;br /&gt;
z = Mid(y, 1, InStr(1, y, &quot; &quot;) - 1)&lt;br /&gt;
&lt;br /&gt;
MsgBox z&lt;br /&gt;
End Sub&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/8300630711179603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/04/subtract-given-noof-days-from-today.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8300630711179603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8300630711179603'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/04/subtract-given-noof-days-from-today.html' title='Subtract the given no.of days from today'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-3974278947440166210</id><published>2010-04-03T23:58:00.000+05:30</published><updated>2010-04-03T23:58:47.070+05:30</updated><title type='text'>How to rename file in a directory</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sub  rename_file()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Dim OldName,  NewName&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;clearfilepath&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;SearchFile&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Range(&quot;A65536&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;ro1 =  Selection.End(xlUp).Row&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;For i = 2 To  ro1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; OldName =  Cells(i, 1).Value &#39;&quot;D:\Documents and  Settings\xxxxxxxxx\Desktop\2010-3-30\chr0101.591&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewName =  OldName &amp;amp; &quot;.csv&quot; &#39; Define file names.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name  OldName As NewName &#39; Rename file.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Next i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;MsgBox &quot;Its  done !!&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Function  SearchFile()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Set fs =  Application.FileSearch&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;With fs&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&#39;‘this code  automatically searches for files in desktop – Source File folder&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .LookIn =  Environ(&quot;userprofile&quot;) &amp;amp; Application.PathSeparator &amp;amp; &quot;Desktop&quot;  &amp;amp; Application.PathSeparator &amp;amp; &quot;Source File&quot; &amp;amp;  Application.PathSeparator&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .FileType =  msoFileTypeAllFiles&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If  .Execute &amp;gt; 0 Then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;For i =  1 To .FoundFiles.Count&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&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;  Range(&quot;A&quot; &amp;amp; (i + 1)).Value = .FoundFiles(i)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  &#39;MsgBox &quot;There were no Binder files found.&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End With&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End Function&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Function  clearfilepath()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sheets(&quot;FilePath&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Range(&quot;A2:A65536&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Selection.ClearContents&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End Function&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/3974278947440166210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/04/how-to-rename-file-in-directory.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/3974278947440166210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/3974278947440166210'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/04/how-to-rename-file-in-directory.html' title='How to rename file in a directory'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-8492855740843392583</id><published>2010-03-30T23:47:00.000+05:30</published><updated>2010-03-30T23:47:23.824+05:30</updated><title type='text'>Draw Border for the common cell values</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sub  Draw_border_for_common_items_in_row()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Sheets(&quot;Sheet1&quot;).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;LC1 =  ActiveSheet.UsedRange.SpecialCells(xlLastCell).Column&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;LR1 =  ActiveSheet.UsedRange.SpecialCells(xlLastCell).Row&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;For i = 1 To  LC1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;temp =  Cells(2, i).Value&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;ro = 2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For j = 2  To LR1&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If  Cells(j, i).Value &amp;lt;&amp;gt; temp Then&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Range(Cells(ro, i), Cells(j - 1, i)).Select&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  Selection.BorderAround Weight:=xlThin&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  ro = j&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;  temp = Cells(j, i).Value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End  If&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next j&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;Next i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;x_MsoNormal&quot; style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;span style=&quot;color: navy; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: navy; font-size: 10pt;&quot;&gt;End Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/8492855740843392583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/draw-border-for-common-cell-values.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8492855740843392583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/8492855740843392583'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/draw-border-for-common-cell-values.html' title='Draw Border for the common cell values'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-7179554130771652643</id><published>2010-03-30T01:29:00.000+05:30</published><updated>2010-03-30T01:29:03.703+05:30</updated><title type='text'>How to Sum the Visible cells data from the filtered range</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Here is the solution to sum the visible cells data from the given range ... :-) &lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Function Sum_Visible_Cells(ByRef Cells_To_Sum As String)&lt;br /&gt;
&lt;br /&gt;
Application.Volatile&lt;br /&gt;
Range(Cells_To_Sum).SpecialCells(xlCellTypeVisible).Select&lt;br /&gt;
Sum_Visible_Cells = WorksheetFunction.Sum(Selection)&lt;br /&gt;
&lt;br /&gt;
End Function&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/7179554130771652643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-sum-visible-cells-data-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7179554130771652643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7179554130771652643'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-sum-visible-cells-data-from.html' title='How to Sum the Visible cells data from the filtered range'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-3729603281802233997</id><published>2010-03-30T01:23:00.002+05:30</published><updated>2010-03-30T01:23:51.225+05:30</updated><title type='text'>How to clean the leading or trailing cell spaces in a given range</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Using this function you can now clean the leading or trailing spaces in the cell range&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Function Clean_cells_in_range(ByRef Cells_to_Clean As String)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each cell In ActiveSheet.Cells.Range(Cells_to_Clean)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cell.Value = Trim(cell)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next cell&lt;br /&gt;
&lt;br /&gt;
End Function&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/3729603281802233997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-clean-leading-or-trailing-cell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/3729603281802233997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/3729603281802233997'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-clean-leading-or-trailing-cell.html' title='How to clean the leading or trailing cell spaces in a given range'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-924167275134480700</id><published>2010-03-30T01:20:00.000+05:30</published><updated>2010-03-30T01:20:39.056+05:30</updated><title type='text'>Subtract the given no.of days from today</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;There might be some instances where you would require to subtract the give number of days from today.... so here is the solution.&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;No need to worry about the month rollback or year rollback... excel would take care of this automatically&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Function Subtract_Date_from_Today(ByRef noofdays As Integer)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; result = Now() - noofdays&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dt = Day(result)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Mo = Month(result)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Yr = Right(Year(result), 2)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; If Len(Mo) = 1 Then Mo = &quot;0&quot; &amp;amp; Mo&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; If Len(Dt) = 1 Then Dt = &quot;0&quot; &amp;amp; Dt&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Subtract_Date_from_Today = Mo &amp;amp; Dt &amp;amp; Yr&lt;br /&gt;
End Function&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/924167275134480700/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/subtract-given-noof-days-from-today.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/924167275134480700'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/924167275134480700'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/subtract-given-noof-days-from-today.html' title='Subtract the given no.of days from today'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-6755773481869797820</id><published>2010-03-30T01:18:00.000+05:30</published><updated>2010-03-30T01:18:16.845+05:30</updated><title type='text'>How to compare dates in Excel Macro</title><content type='html'>&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Well this is quite simple.... if you have a cell value as 3/28/10 (m/dd/yy)... which is 3rd March 2010 and you need to compare this with the data 28/03/2010 ... which is in dd/mm/yyyy format&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;All you need to do is to convert the data in the required format to match&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;compare_Dt = Format(DateSerial(Yr, Mo, Dt), &quot;mm/dd/yyyy&quot;)&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&lt;br /&gt;
For j = rng1 to rng2&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Source= Format(Cells(3, j).Value, &quot;mm/dd/yyyy&quot;)&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Source = compare_Dt Then&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; your code when the date matches&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; Exit For &lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/div&gt;&lt;div style=&quot;font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;&quot;&gt;Next&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/6755773481869797820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-compare-dates-in-excel-macro.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/6755773481869797820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/6755773481869797820'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-compare-dates-in-excel-macro.html' title='How to compare dates in Excel Macro'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3967404005362840312.post-7538841660606302006</id><published>2010-03-30T01:12:00.000+05:30</published><updated>2010-03-30T01:12:12.975+05:30</updated><title type='text'>How to convert Column Number to Name</title><content type='html'>Using the below function you can now convert the column number to name&lt;br /&gt;
...for eg.. if the col no is 26 then this function would return &quot;Z&quot; as column name&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Function Convert_Column()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim MyColumn As String, Here As String&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; Get the address of the active cell in the current selection&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Here = ActiveCell.Address&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; Because .Address is $&lt;columnletter&gt;$&lt;rownumber&gt;, drop the first&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &#39; character and the characters after the column letter(s).&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Convert_Column = Mid(Here, InStr(Here, &quot;$&quot;) + 1, InStr(2, Here, &quot;$&quot;) - 2)&lt;br /&gt;
End Function&lt;/rownumber&gt;&lt;/columnletter&gt;</content><link rel='replies' type='application/atom+xml' href='http://excelmacroman.blogspot.com/feeds/7538841660606302006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-convert-column-number-to-name.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7538841660606302006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3967404005362840312/posts/default/7538841660606302006'/><link rel='alternate' type='text/html' href='http://excelmacroman.blogspot.com/2010/03/how-to-convert-column-number-to-name.html' title='How to convert Column Number to Name'/><author><name>Vijay</name><uri>http://www.blogger.com/profile/07920275168218026967</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxQ9759wWP34zj4hqlnRD__5lkZw_osyrHFZWnd-9FOfaeWaCjjowzgeRqAI1JBMirXOAqjxSYND2NexzuYeo4zvNDWhz5op7MEqC4j4JZHCFEvCB2YY1dHmfJ-uQWGos/s220/Image027.jpg'/></author><thr:total>0</thr:total></entry></feed>