<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="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" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-4327993088253659317</atom:id><lastBuildDate>Tue, 24 Mar 2026 07:57:39 +0000</lastBuildDate><category>Excel VBA Fundamentals</category><category>Advanced Excel VBA</category><category>Excel Password Protection</category><category>ActiveX Data Objects (ADO)</category><category>Blogger’s Notes</category><category>Business / Financial</category><category>Excel VBA Editor</category><category>Simple Tips</category><category>VBA Editor</category><category>Connection String</category><category>Data Access Objects (DAO)</category><category>Decision Support System</category><category>Excel Amortization Table</category><category>Excel Database Application</category><category>PMT Function</category><category>Pareto Chart Analysis</category><category>Checking Excel File</category><category>Currency Conversion</category><category>Customize Excel Menu</category><category>DBMS</category><category>Data Consolidation</category><category>Data Validation</category><category>Dollar-Cost Averaging</category><category>Excel Data Entry Form</category><category>Excel Form Controls</category><category>Excel Help</category><category>Export To Excel</category><category>Firefox</category><category>Forex</category><category>Investment Tool</category><category>MS Word</category><category>Macro Recorder</category><category>Mutual Fund Calculator</category><category>Project Explorer</category><category>Project Management</category><category>Properties Window</category><category>Recordset</category><category>Vendor Information Management</category><category>Web Query</category><category>Windows</category><category>Worksheet Function</category><title>Pro-business Excel VBA Programming</title><description>Excel Macro VBA Writing Tips and Source Codes by Joel T. Protusada</description><link>http://msexcelvba.blogspot.com/</link><managingEditor>noreply@blogger.com (Unknown)</managingEditor><generator>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-8991686758885525644</guid><pubDate>Sun, 14 Sep 2008 06:21:00 +0000</pubDate><atom:updated>2008-10-06T12:32:25.837+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Data Consolidation</category><title>Data Consolidation In Excel - Part 1</title><description>&lt;blockquote&gt;&lt;em&gt;Note: We are not going to discuss here the Consolidation function of Excel. The said &lt;/em&gt;&lt;em&gt;function is used if you want to sum up multiple numbers from different Excel files &lt;/em&gt;&lt;em&gt;that have same format into a single Excel file. I&#39;ve got limited time to post to discuss it but will try to tackle it in the near future. &lt;/em&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;In this post, we will combine records from different files with different format. Appending them all in a single Excel file. No summation will be done.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Data Consolidation&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Is it to much tedious if you copy and paste manually sets of data from multiple files and append them all together in a master file? Let&#39;s say you have 50 files of records and you open them one by one and copy the records and paste into a single file. And the most boring of all about it is that you need to do it over and over again in a weekly basis. Of course, you will agree with me that it is tedious.&lt;br /&gt;&lt;br /&gt;If you find yourself in that situation and don&#39;t want to do the same thing manually weekly, then you can automate the whole process. The long hours of doing it manually can be reduced in an hour or two with a macro program.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Source Data&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So let&#39;s start by creating the files to be combined together. For our example, we will create 3 different source files; an Excel file, CSV file, and a Tab delimited file.&lt;br /&gt;&lt;br /&gt;Excel File -- Create a new Excel file and copy the data in the following screen shot and save as Excel file, of course :)&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwE0D2Co0IW11a5s_FNJoM6XIpTVIIm2qI92-0oy70zTNwrjUMNv6YsWl0YdHrlZSW4U2lmfQRZ9EAbLBn7g7QEkjC2EWfPGoA57dGuNTXvFErF55Nav_HZr3Ictttu_PwE2Hg_aGdhUMe/s1600-h/data-consolidation-in-excel-1.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5245715146370955714&quot; style=&quot;FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwE0D2Co0IW11a5s_FNJoM6XIpTVIIm2qI92-0oy70zTNwrjUMNv6YsWl0YdHrlZSW4U2lmfQRZ9EAbLBn7g7QEkjC2EWfPGoA57dGuNTXvFErF55Nav_HZr3Ictttu_PwE2Hg_aGdhUMe/s320/data-consolidation-in-excel-1.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CSV File -- In Excel, copy the data in the following screen shot and save it in CSV format by clicking &quot;Save As&quot; in the File menu. Change the file type to CSV before clicking the Save button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjchy7cXHqLzlBuRNfBEkeXwkd64KYHwriaGy1JCWol40hlhZV2S46UkCWvQS9CwWp_ECMsTnNXBVeOOR2xt1xoFt_cU-qedsuG2CogwGObuJhN59oqLqInP9_b4GVJG7Cv5ppwsz9gf0UP/s1600-h/data-consolidation-in-excel-2.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5245715145202896050&quot; style=&quot;FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjchy7cXHqLzlBuRNfBEkeXwkd64KYHwriaGy1JCWol40hlhZV2S46UkCWvQS9CwWp_ECMsTnNXBVeOOR2xt1xoFt_cU-qedsuG2CogwGObuJhN59oqLqInP9_b4GVJG7Cv5ppwsz9gf0UP/s320/data-consolidation-in-excel-2.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tab Delimited -- In Excel, copy the data in the following screen shot and save it in Tab delimited text file by clicking the &quot;Save As&quot; in the File menu. Change the file type to &quot;Tab delimited&quot; before clicking the Save button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5fIusAK6RNE_xTa5CtYRxOHkGW1T1TVX94EYbXlwNBlgGdnnFLUGgHwnz5tMI3FsKdiwCCJ2HxJEIjzPxO33VsOEF7erqiPeqnSvi4ZU6seq2OKzir21tBns0ikDNAujSxRzoGpVYkfu/s1600-h/data-consolidation-in-excel-3.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5245715150554204626&quot; style=&quot;FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn5fIusAK6RNE_xTa5CtYRxOHkGW1T1TVX94EYbXlwNBlgGdnnFLUGgHwnz5tMI3FsKdiwCCJ2HxJEIjzPxO33VsOEF7erqiPeqnSvi4ZU6seq2OKzir21tBns0ikDNAujSxRzoGpVYkfu/s320/data-consolidation-in-excel-3.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Recording Data Import&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;AT this point, we will extract records from the files that we created while we are macro recording it. To start the Macro Recorder, please see my post on how to do that at &lt;a href=&quot;http://msexcelvba.blogspot.com/2007/07/easiest-way-to-learn-vba-thru-macro.html&quot;&gt;Easiest Way to Learn Excel VBA Programming by Macro Recorder&lt;/a&gt;. Once it is up and running, we will do the data extraction of the 3 files. But it is much better if you will start and stop the macro recorder for each file extraction so that each file will have its own procedure module. then we will examine each module one by one to learn the difference.&lt;br /&gt;&lt;br /&gt;To extract the file, follow the instruction in my previous post, &lt;a href=&quot;http://msexcelvba.blogspot.com/2008/08/export-to-excel.html&quot;&gt;Export To Excel&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You should generate the same codes as below:&lt;br /&gt;&lt;br /&gt;Source Code for Excel file.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub Macro1()&lt;br /&gt;    &#39;&lt;br /&gt;    &#39; Macro1 Macro&lt;br /&gt;    &#39; Macro recorded 9/14/2008 by Joel.Protusada&lt;br /&gt;    &#39;&lt;br /&gt;    &lt;br /&gt;    &#39;&lt;br /&gt;    With ActiveSheet.QueryTables.Add(Connection:=Array( _&lt;br /&gt;        &quot;OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;&quot; &amp; _&lt;br /&gt;        &quot;Password=&quot;&quot;&quot;&quot;;User ID=Admin;Data Source=&quot; &amp; _&lt;br /&gt;        &quot;E:\Consolidation\Sales branch1.xls;&quot; &amp; _&lt;br /&gt;        &quot;Mode=Share Deny Write;&quot;, _&lt;br /&gt;        &quot;Extended Properties=&quot;&quot;HDR=YES;&quot;&quot;;Jet OLEDB:&quot; &amp; _&lt;br /&gt;        &quot;System database=&quot;&quot;&quot;&quot;;&quot; &amp; _&lt;br /&gt;        &quot;Jet OLEDB:Registry Path=&quot;&quot;&quot;&quot;;Jet OLEDB:&quot; &amp; _&lt;br /&gt;        &quot;Database Password=&quot;&quot;&quot;&quot;;Jet OLEDB:&quot;, _&lt;br /&gt;        &quot;Engine Type=35;Jet OLEDB:Database &quot; &amp; _&lt;br /&gt;        &quot;Locking Mode=0;Jet OLEDB:&quot; &amp; _&lt;br /&gt;        &quot;Global Partial Bulk Ops=2;Jet OLEDB:Global &quot; &amp; _&lt;br /&gt;        &quot;Bulk Transactions=1;Jet OL&quot;, _&lt;br /&gt;        &quot;EDB:New Database Password=&quot;&quot;&quot;&quot;;Jet OLEDB:&quot; &amp; _&lt;br /&gt;        &quot;Create System Database=&quot; &amp; _&lt;br /&gt;        &quot;False;Jet OLEDB:Encrypt Database=False;Jet &quot; &amp; _&lt;br /&gt;        &quot;OLEDB:Don&#39;t Copy Locale&quot;, _&lt;br /&gt;        &quot; on Compact=False;Jet OLEDB:Compact &quot; &amp; _&lt;br /&gt;        &quot;Without Replica &quot; &amp; _&lt;br /&gt;        &quot;Repair=False;Jet OLEDB:SFP=False&quot; _&lt;br /&gt;        ), Destination:=Range(&quot;A1&quot;))&lt;br /&gt;        .CommandType = xlCmdTable&lt;br /&gt;        .CommandText = Array(&quot;Sheet1$&quot;)&lt;br /&gt;        .Name = &quot;Sales branch1&quot;&lt;br /&gt;        .FieldNames = True&lt;br /&gt;        .RowNumbers = False&lt;br /&gt;        .FillAdjacentFormulas = False&lt;br /&gt;        .PreserveFormatting = True&lt;br /&gt;        .RefreshOnFileOpen = False&lt;br /&gt;        .BackgroundQuery = True&lt;br /&gt;        .RefreshStyle = xlInsertDeleteCells&lt;br /&gt;        .SavePassword = False&lt;br /&gt;        .SaveData = True&lt;br /&gt;        .AdjustColumnWidth = True&lt;br /&gt;        .RefreshPeriod = 0&lt;br /&gt;        .PreserveColumnInfo = True&lt;br /&gt;        .SourceDataFile = _&lt;br /&gt;        &quot;E:\Consolidation\Sales branch1.xls&quot;&lt;br /&gt;        .Refresh BackgroundQuery:=False&lt;br /&gt;    End With&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Source code for CSV file.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub Macro2()&lt;br /&gt;    &#39;&lt;br /&gt;    &#39; Macro2 Macro&lt;br /&gt;    &#39; Macro recorded 9/14/2008 by Joel.Protusada&lt;br /&gt;    &#39;&lt;br /&gt;  &lt;br /&gt;    &#39;&lt;br /&gt;    With ActiveSheet.QueryTables.Add(Connection:= _&lt;br /&gt;        &quot;TEXT;E:\Consolidation\Sales branch2.csv&quot;, _&lt;br /&gt;        Destination:=Range(&quot;A1&quot;))&lt;br /&gt;        .Name = &quot;Sales branch2&quot;&lt;br /&gt;        .FieldNames = True&lt;br /&gt;        .RowNumbers = False&lt;br /&gt;        .FillAdjacentFormulas = False&lt;br /&gt;        .PreserveFormatting = True&lt;br /&gt;        .RefreshOnFileOpen = False&lt;br /&gt;        .RefreshStyle = xlInsertDeleteCells&lt;br /&gt;        .SavePassword = False&lt;br /&gt;        .SaveData = True&lt;br /&gt;        .AdjustColumnWidth = True&lt;br /&gt;        .RefreshPeriod = 0&lt;br /&gt;        .TextFilePromptOnRefresh = False&lt;br /&gt;        .TextFilePlatform = 437&lt;br /&gt;        .TextFileStartRow = 1&lt;br /&gt;        .TextFileParseType = xlDelimited&lt;br /&gt;        .TextFileTextQualifier = xlTextQualifierDoubleQuote&lt;br /&gt;        .TextFileConsecutiveDelimiter = False&lt;br /&gt;        .TextFileTabDelimiter = False&lt;br /&gt;        .TextFileSemicolonDelimiter = False&lt;br /&gt;        .TextFileCommaDelimiter = True&lt;br /&gt;        .TextFileSpaceDelimiter = False&lt;br /&gt;        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1)&lt;br /&gt;        .TextFileTrailingMinusNumbers = True&lt;br /&gt;        .Refresh BackgroundQuery:=False&lt;br /&gt;    End With&lt;br /&gt;    Sheets(&quot;Sheet3&quot;).Select&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Source code for the tab delimited file.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub Macro3()&lt;br /&gt;    &#39;&lt;br /&gt;    &#39; Macro3 Macro&lt;br /&gt;    &#39; Macro recorded 9/14/2008 by JPCORP&lt;br /&gt;    &#39;&lt;br /&gt;  &lt;br /&gt;    &#39;&lt;br /&gt;    With ActiveSheet.QueryTables.Add(Connection:= _&lt;br /&gt;        &quot;TEXT;E:\Consolidation\Sales branch3.txt&quot;, _&lt;br /&gt;        Destination:=Range(&quot;A1&quot;))&lt;br /&gt;        .Name = &quot;Sales branch3&quot;&lt;br /&gt;        .FieldNames = True&lt;br /&gt;        .RowNumbers = False&lt;br /&gt;        .FillAdjacentFormulas = False&lt;br /&gt;        .PreserveFormatting = True&lt;br /&gt;        .RefreshOnFileOpen = False&lt;br /&gt;        .RefreshStyle = xlInsertDeleteCells&lt;br /&gt;        .SavePassword = False&lt;br /&gt;        .SaveData = True&lt;br /&gt;        .AdjustColumnWidth = True&lt;br /&gt;        .RefreshPeriod = 0&lt;br /&gt;        .TextFilePromptOnRefresh = False&lt;br /&gt;        .TextFilePlatform = 437&lt;br /&gt;        .TextFileStartRow = 1&lt;br /&gt;        .TextFileParseType = xlDelimited&lt;br /&gt;        .TextFileTextQualifier = xlTextQualifierDoubleQuote&lt;br /&gt;        .TextFileConsecutiveDelimiter = False&lt;br /&gt;        .TextFileTabDelimiter = True&lt;br /&gt;        .TextFileSemicolonDelimiter = False&lt;br /&gt;        .TextFileCommaDelimiter = False&lt;br /&gt;        .TextFileSpaceDelimiter = False&lt;br /&gt;        .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1)&lt;br /&gt;        .TextFileTrailingMinusNumbers = True&lt;br /&gt;        .Refresh BackgroundQuery:=False&lt;br /&gt;    End With&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see there are almost no difference between the CSV and Tab file. So in our programming we will modify the codes above and we will create a single subroutine to handle both CSV and Tab files, and a separate subroutine for Excel files.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold&quot;&gt;Project Details&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before we start with the actual programming, we need to be precised in the parameters of our consolidation. Below is the brief specifications of it:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;To trigger the consolidation, an option in the menu should be added to run it. To do that visit my post &lt;a href=&quot;http://msexcelvba.blogspot.com/search/label/Customize%20Excel%20Menu&quot;&gt;Create Customize Excel Menu&lt;/a&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;All the files to be consolidated should be residing in the same folder as the master file. The master file is an Excel file that will serve as the repository of all the records. It also has the consolidation macro program.&lt;/li&gt;&lt;li&gt;There will be only three data file formats to be recognized by the program; Excel, CSV, and tab delimited. If there is a need for other format, you can easily modify the program that we will make here.&lt;/li&gt;&lt;li&gt;program should follow the flow chart below:&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdV5xBqxsh_p3YUqlTCIvx4cFtrPhCItwy0nbLpwOWvX_B245vRo0mJ-54sqU71wx7Aug3UDdJ-BCIlbpOzNEcruCoL0_YsHjuf1UpPyDGUnBGZUzYvn1XXweBZt4a9sCYNbWyiV4B7ZWg/s1600-h/data-consolidation-in-excel-4.jpg&quot;&gt;&lt;img id=&quot;BLOGGER_PHOTO_ID_5245740382850086290&quot; style=&quot;FLOAT: left; MARGIN: 0pt 10px 10px 0pt; CURSOR: pointer&quot; alt=&quot;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjdV5xBqxsh_p3YUqlTCIvx4cFtrPhCItwy0nbLpwOWvX_B245vRo0mJ-54sqU71wx7Aug3UDdJ-BCIlbpOzNEcruCoL0_YsHjuf1UpPyDGUnBGZUzYvn1XXweBZt4a9sCYNbWyiV4B7ZWg/s400/data-consolidation-in-excel-4.jpg&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;FONT-WEIGHT: bold&quot;&gt;Modified Macro Program&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As I&#39;ve said we will modify the code above to subroutines that we can use and reuse in our programming. Below is the modified recorded macro for the Excel file extraction:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub ExtractExcelData(strPath As String, _&lt;br /&gt;strFile As String, strSheet As String)&lt;br /&gt;Sheets(strSheet).Select&lt;br /&gt;With ActiveSheet.QueryTables.Add(Connection:=Array( _&lt;br /&gt; &quot;OLEDB;Provider=Microsoft.Jet.OLEDB.4.0;&quot; &amp;amp; _&lt;br /&gt; &quot;Password=&quot;&quot;&quot;&quot;;User ID=Admin;Data Source=&quot; &amp;amp; _&lt;br /&gt; strPath &amp;amp; strFile &amp;amp; &quot;;Mode=Share Deny Write;&quot;, _&lt;br /&gt; &quot;Extended Properties=&quot;&quot;HDR=YES;&quot;&quot;;Jet OLEDB&quot; &amp;amp; _&lt;br /&gt; &quot;:System database=&quot;&quot;&quot;&quot;;Jet OLEDB:Registry Path=&quot;&quot;&quot;&quot;;Jet OLEDB&quot; &amp;amp; _&lt;br /&gt; &quot;:Database Password=&quot;&quot;&quot;&quot;;Jet OLEDB:&quot;, _&lt;br /&gt; &quot;Engine Type=35;Jet OLEDB:Database Locking Mode=0;&quot; &amp;amp; _&lt;br /&gt; &quot;Jet OLEDB:Global Partial Bulk Ops=2;&quot; &amp;amp; _&lt;br /&gt; &quot;Jet OLEDB:Global Bulk Transactions=1;Jet OL&quot;, _&lt;br /&gt; &quot;EDB:New Database Password=&quot;&quot;&quot;&quot;;Jet OLEDB:&quot; &amp;amp; _&lt;br /&gt; &quot;Create System Database=False;Jet OLEDB:&quot; &amp;amp; _&lt;br /&gt; &quot;Encrypt Database=False;Jet OLEDB:Don&#39;t Copy Locale&quot;, _&lt;br /&gt; &quot; on Compact=False;Jet OLEDB:Compact Without Replica &quot; &amp;amp; _&lt;br /&gt; &quot;Repair=False;Jet OLEDB:SFP=False&quot; _&lt;br /&gt; ), Destination:=Range(&quot;A1&quot;))&lt;br /&gt; .CommandType = xlCmdTable&lt;br /&gt; .CommandText = Array(&quot;Sheet1$&quot;)&lt;br /&gt; .Name = &quot;Sales branch1&quot;&lt;br /&gt; .FieldNames = True&lt;br /&gt; .RowNumbers = False&lt;br /&gt; .FillAdjacentFormulas = False&lt;br /&gt; .PreserveFormatting = True&lt;br /&gt; .RefreshOnFileOpen = False&lt;br /&gt; .BackgroundQuery = True&lt;br /&gt; .RefreshStyle = xlInsertDeleteCells&lt;br /&gt; .SavePassword = False&lt;br /&gt; .SaveData = True&lt;br /&gt; .AdjustColumnWidth = True&lt;br /&gt; .RefreshPeriod = 0&lt;br /&gt; .PreserveColumnInfo = True&lt;br /&gt; .SourceDataFile = strPath &amp;amp; strFile&lt;br /&gt; .Refresh BackgroundQuery:=False&lt;br /&gt;End With&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;To test the above procedure, the correct parameters should be supplied like the example below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub TestExtractExcelData()&lt;br /&gt;ExtractExcelData &quot;E:\consolidation\&quot;, &quot;Sales branch1.xls&quot;, &quot;sheet4&quot;&lt;br /&gt;&#39;Parameters are:&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(255,0,0)&quot;&gt;&#39;strPath - folder where to get the file&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(255,0,0)&quot;&gt;    &#39;strFile - Excel filename of the source data.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(255,0,0)&quot;&gt;    &#39;strSheet - woeksheet where to put the data.&lt;/span&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here&#39;s the subroutine for the CSV and Tab files extraction:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub ExtractTextData(strPath As String, _&lt;br /&gt;strFile As String, strSheet As String, isCSV As Boolean)&lt;br /&gt;Dim MyRecords&lt;br /&gt;Sheets(strSheet).Select&lt;br /&gt;If isCSV Then&lt;br /&gt;   Set MyRecords = ActiveSheet.QueryTables.Add(Connection:= _&lt;br /&gt;   &quot;TEXT;&quot; &amp;amp; strPath &amp;amp; strFile, Destination:=Range(&quot;A1&quot;))&lt;br /&gt;Else&lt;br /&gt;   Set MyRecords = ActiveSheet.QueryTables.Add(Connection:= _&lt;br /&gt;   &quot;TEXT;&quot; &amp;amp; strPath &amp;amp; strFile, Destination:=Range(&quot;A1&quot;))&lt;br /&gt;End If&lt;br /&gt;With MyRecords&lt;br /&gt;   .Name = Left(strFile, Len(strFile) - 4)&lt;br /&gt;   If isCSV Then&lt;br /&gt;       .TextFileCommaDelimiter = True&lt;br /&gt;       .TextFileTabDelimiter = False&lt;br /&gt;   Else&lt;br /&gt;       .TextFileCommaDelimiter = False&lt;br /&gt;       .TextFileTabDelimiter = True&lt;br /&gt;   End If&lt;br /&gt;   .FieldNames = True&lt;br /&gt;   .RowNumbers = False&lt;br /&gt;   .FillAdjacentFormulas = False&lt;br /&gt;   .PreserveFormatting = True&lt;br /&gt;   .RefreshOnFileOpen = False&lt;br /&gt;   .RefreshStyle = xlInsertDeleteCells&lt;br /&gt;   .SavePassword = False&lt;br /&gt;   .SaveData = True&lt;br /&gt;   .AdjustColumnWidth = True&lt;br /&gt;   .RefreshPeriod = 0&lt;br /&gt;   .TextFilePromptOnRefresh = False&lt;br /&gt;   .TextFilePlatform = 437&lt;br /&gt;   .TextFileStartRow = 1&lt;br /&gt;   .TextFileParseType = xlDelimited&lt;br /&gt;   .TextFileTextQualifier = xlTextQualifierDoubleQuote&lt;br /&gt;   .TextFileConsecutiveDelimiter = False&lt;br /&gt;   .TextFileSemicolonDelimiter = False&lt;br /&gt;   .TextFileSpaceDelimiter = False&lt;br /&gt;   .TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1)&lt;br /&gt;   .TextFileTrailingMinusNumbers = True&lt;br /&gt;   .Refresh BackgroundQuery:=False&lt;br /&gt;End With&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here&#39;s the code to test it.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub TestExtractCSVData()&lt;br /&gt;ExtractTextData &quot;E:\consolidation\&quot;, _&lt;br /&gt;&quot;Sales branch2.csv&quot;, &quot;sheet5&quot;, True&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Sub TestExtractTabData()&lt;br /&gt;ExtractTextData &quot;E:\consolidation\&quot;, &quot;Sales branch3.txt&quot;, _&lt;br /&gt;&quot;sheet6&quot;, False&lt;br /&gt;End Sub&lt;br /&gt;&lt;span style=&quot;COLOR: rgb(255,0,0)&quot;&gt;&#39;Parameters are the same as in the Excel routine.&lt;br /&gt;&#39;The fourth parameter is a boolean type which&lt;br /&gt;&#39;means that if the TRUE, it is a CSV file,&lt;br /&gt;&#39;otherwise Tab file. &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So there you go. Those are the codes to do it. I will post soon the whole VBA program as it is too long to include it here.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/09/data-consolidation-in-excel.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwE0D2Co0IW11a5s_FNJoM6XIpTVIIm2qI92-0oy70zTNwrjUMNv6YsWl0YdHrlZSW4U2lmfQRZ9EAbLBn7g7QEkjC2EWfPGoA57dGuNTXvFErF55Nav_HZr3Ictttu_PwE2Hg_aGdhUMe/s72-c/data-consolidation-in-excel-1.jpg" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-7125356465765612767</guid><pubDate>Fri, 22 Aug 2008 10:00:00 +0000</pubDate><atom:updated>2008-08-23T00:15:36.600+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Database Application</category><category domain="http://www.blogger.com/atom/ns#">Export To Excel</category><title>Export To Excel</title><description>This is the first part of our discussion on how to export data to Excel. We will start with the simplest one; how to transfer data from a flat file (CSV, Tab delimited, PSV, etc.) to Excel. Let&#39;s know first what is a flat file...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is a flat  file?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Flat_file_database&quot;&gt;Wikipedia&lt;/a&gt; described it  best...&lt;blockquote&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt;A flat file is a file that contains records, and&lt;/span&gt;&lt;span style=&quot;font-style: italic; color: rgb(0, 153, 0);&quot;&gt; in which each record is specified in a single line. Fields from each record may simply have a fixed width with padding, or may be delimited by whitespace, tabs, commas (CSV) or other characters. Extra formatting may be needed to avoid delimiter collision. There are no structural relationships. The data are &quot;flat&quot; as in a sheet of paper, in contrast to more complex models such as a relational database.&lt;/span&gt;&lt;/blockquote&gt;In short it&#39;s an ordinary file that stores records in sequential order.&lt;br /&gt;&lt;br /&gt;This simple pattern of records saved in a file makes it possible for Excel to extract them and load into worksheet cells. A function is available in Excel to do it with a wizard tool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Export To Excel&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1.) Before we can export records to Excel, we need to have source file. So, let&#39;s create one  by opening Windows Notepad and enter the set of data exactly as shown in the screen grab below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDHl-3XeT-1vO0WBdjR6M1L53ahZkTaEFWCxAhyphenhyphenIrTG25jLd-bDtZ4xjcxCP87r66ouAyTW2oDVyO5kxV3HeXLTWmqI8Omlv6hdH2fu2zKFxJdZhLHurP6pzVzJLERII8Xu_8wlotuc8ON/s1600-h/EXPORT-TO-EXCEL-1.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDHl-3XeT-1vO0WBdjR6M1L53ahZkTaEFWCxAhyphenhyphenIrTG25jLd-bDtZ4xjcxCP87r66ouAyTW2oDVyO5kxV3HeXLTWmqI8Omlv6hdH2fu2zKFxJdZhLHurP6pzVzJLERII8Xu_8wlotuc8ON/s400/EXPORT-TO-EXCEL-1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237343084997386450&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The sample records I created are list of customers. Each field should be separated by a Pipe (&quot;|&quot;) character. After entering the string above, save the file. In my case, I named it &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Customer&lt;/span&gt;. The filename would have a&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-weight: bold; color: rgb(51, 51, 255);&quot;&gt;&lt;span style=&quot;color: rgb(0, 0, 153);&quot;&gt;.TXT&lt;/span&gt; &lt;/span&gt;extension, but since our data is pipe delimited, we should rename the extension to &lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;.PSV&lt;/span&gt; (Pipe Separated Value). We have now &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Customer.PSV&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;2.) Create a new Excel worksheet. On the menu, click &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Data&gt;Import External Data&gt;Import Data&lt;/span&gt; as shown below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2kMpf05ESLWgQtTH8Zggxd7dTnYCymXm7O7hFf9UGnbpX-_p_QdVdszPJSLsx3PfeQGb1k-zltHM9-bKq5v7_PugoZeCospr00VZ05yNX1uaLoD_dR7CLUfke6PGTCurWPX2Uru4EjjOl/s1600-h/EXPORT-TO-EXCEL-2.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2kMpf05ESLWgQtTH8Zggxd7dTnYCymXm7O7hFf9UGnbpX-_p_QdVdszPJSLsx3PfeQGb1k-zltHM9-bKq5v7_PugoZeCospr00VZ05yNX1uaLoD_dR7CLUfke6PGTCurWPX2Uru4EjjOl/s400/EXPORT-TO-EXCEL-2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237353368697723730&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.) This will bring out the &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Select Data Source&lt;/span&gt; window:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinQ5ZhnGtFl3bkEzh6CDMQmpqwtAInYxO2fR19Wsblo0a5acu_gjtejCJOcnYwlL7MjDnaiK57ppduOkrijwu4W3is-d8MhwKoFi_xdXthUFALzVH2EXtmVKa-60d_WYTt3C41O3-jMoy0/s1600-h/EXPORT-TO-EXCEL-3.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinQ5ZhnGtFl3bkEzh6CDMQmpqwtAInYxO2fR19Wsblo0a5acu_gjtejCJOcnYwlL7MjDnaiK57ppduOkrijwu4W3is-d8MhwKoFi_xdXthUFALzVH2EXtmVKa-60d_WYTt3C41O3-jMoy0/s320/EXPORT-TO-EXCEL-3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237356941247729586&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this window, you will see many choices in the &quot;&lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;Files of type&lt;/span&gt;&quot; pull down list but you need only to choose &lt;span style=&quot;color: rgb(0, 0, 153); font-weight: bold;&quot;&gt;All files (*.*) &lt;/span&gt;because PSV format is not included in the list. Locate the Customer.PSV then double click it.&lt;br /&gt;&lt;br /&gt;4.) The Text Import Wizard appears as shown below. Do not change the default &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Delimited&lt;/span&gt; in the &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Original data type&lt;/span&gt; as our records are delimited by a pipe character. Click Next button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJWQmyC_rIAnAUElbKZFuRLRdTVmLQaieyTqjbO7mSn6ot0QYrAuV9Es75owgbvKEYzgrjGPGVlrHWcmbazGk0_qExfel5CpmNJadnE6mElXFcDiclYh886lCf3Kr1L2ueK_vbFmFoCPVe/s1600-h/EXPORT-TO-EXCEL-4.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJWQmyC_rIAnAUElbKZFuRLRdTVmLQaieyTqjbO7mSn6ot0QYrAuV9Es75owgbvKEYzgrjGPGVlrHWcmbazGk0_qExfel5CpmNJadnE6mElXFcDiclYh886lCf3Kr1L2ueK_vbFmFoCPVe/s320/EXPORT-TO-EXCEL-4.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237362468123779186&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5.)  The second screen of the wizard appears. Check the &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Other&lt;/span&gt; check box and put a pipe in the text field next to it. See below how. Then click Next button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhff9Y1IDG5HZwa5ycqq6ae-y49XtqMjraLFqK1v9KKmYCua8Gtmn91J-pI6MpQo8y1piQg0xPgf40bhe5xYkvv1_lJrRW2Jlog1ETvjYzlY-foezUj6q5Ku0wqr9_qCbK8co-IP5iP8c6C/s1600-h/EXPORT-TO-EXCEL-5.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhff9Y1IDG5HZwa5ycqq6ae-y49XtqMjraLFqK1v9KKmYCua8Gtmn91J-pI6MpQo8y1piQg0xPgf40bhe5xYkvv1_lJrRW2Jlog1ETvjYzlY-foezUj6q5Ku0wqr9_qCbK8co-IP5iP8c6C/s320/EXPORT-TO-EXCEL-5.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237363751260513266&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;6.)  The third screen of the wizard appears (see below). Here you usually  indicate the data type of each  column. But in the case of our sample records, we will just click Finish button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhJuOyE6kF_07yY5cXmgfwQPAyLQrSchhALKRuI2b_k1VmiR6NpEFUmf1fzzY3NEu4XVk87yRtCUXl-Yq-WXIpeqPPsUjGU1o4KLapEl7s-SVaRYA-bQif7VFkXEL1bwluGUOptpzUfWB_/s1600-h/EXPORT-TO-EXCEL-6.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhJuOyE6kF_07yY5cXmgfwQPAyLQrSchhALKRuI2b_k1VmiR6NpEFUmf1fzzY3NEu4XVk87yRtCUXl-Yq-WXIpeqPPsUjGU1o4KLapEl7s-SVaRYA-bQif7VFkXEL1bwluGUOptpzUfWB_/s320/EXPORT-TO-EXCEL-6.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237366501960599922&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;7.)  The &lt;span style=&quot;font-weight: bold; color: rgb(0, 0, 153);&quot;&gt;Import Data&lt;/span&gt; window pops out, choose Existing worksheet since we juist created a new one and click Ok to store all the records in the worksheet as shown in the screen grab below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3vdgCfS5TWE0FUpX_ozm-INwfDt5NjNjSteLBkIoaI3_IFBVqHRSR0US-EAQd83zykTeQa0joYkik128-z7nwIygVbjiei2Hwl6nvB8DhHhdhGWZ_qGBGXBXXEEqpMZH22-7xVihXToMA/s1600-h/EXPORT-TO-EXCEL-8.jpg&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3vdgCfS5TWE0FUpX_ozm-INwfDt5NjNjSteLBkIoaI3_IFBVqHRSR0US-EAQd83zykTeQa0joYkik128-z7nwIygVbjiei2Hwl6nvB8DhHhdhGWZ_qGBGXBXXEEqpMZH22-7xVihXToMA/s320/EXPORT-TO-EXCEL-8.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5237369582919037282&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;We are done.&lt;br /&gt;&lt;br /&gt;Now you know how to export records from a text file into Excel and having these records in the worksheet you can now manipulate the data the way you want. You can pivot them to summarize and come up with useful information, or you can consolidate them with other data extracted from other source, etc.&lt;br /&gt;&lt;br /&gt;In my next post, we will discuss consolidation of records from different files using VBA programming.&lt;br /&gt;&lt;br /&gt;Happy Weekend :)&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/08/export-to-excel.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDHl-3XeT-1vO0WBdjR6M1L53ahZkTaEFWCxAhyphenhyphenIrTG25jLd-bDtZ4xjcxCP87r66ouAyTW2oDVyO5kxV3HeXLTWmqI8Omlv6hdH2fu2zKFxJdZhLHurP6pzVzJLERII8Xu_8wlotuc8ON/s72-c/EXPORT-TO-EXCEL-1.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-8301906936051317890</guid><pubDate>Fri, 08 Aug 2008 13:49:00 +0000</pubDate><atom:updated>2008-08-07T23:54:47.529+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Decision Support System</category><category domain="http://www.blogger.com/atom/ns#">Pareto Chart Analysis</category><title>Pareto Chart Example</title><description>I will give you a very simple Pareto chart example. Create a new workbook and enter exactly the same figures in the screen shot below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJaAQaFlPtRholwaZ1BIKPIoe6Cwn90Yg8WFG9WS49n2nmfOuKl7rEPFicXfZYcnrpk6EtJcMypsLwRVOh0ZE94avELgmzt66RdYpIxHB-0N0FQ0e6V1lVa92LokOFAJHuhL-NDfy3awB4/s1600-h/pareto-chart1.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJaAQaFlPtRholwaZ1BIKPIoe6Cwn90Yg8WFG9WS49n2nmfOuKl7rEPFicXfZYcnrpk6EtJcMypsLwRVOh0ZE94avELgmzt66RdYpIxHB-0N0FQ0e6V1lVa92LokOFAJHuhL-NDfy3awB4/s400/pareto-chart1.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5231801674760267154&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The worksheet above is an example of list of reasons why you lost business proposals or quotes to other competitors. Column A has the reason descriptions. Column B has the corresponding number of times with that lost reasons in Column A. Column C has the percentages. Column D is the running percentages of Column C.&lt;br /&gt;&lt;br /&gt;Highlight the range A1 to A6. Press Ctrl key simultaneously on highlighting the C1 to D6. Then click the &lt;span style=&quot;color: rgb(255, 0, 0); font-weight: bold;&quot;&gt;Insert&gt;Chart&lt;/span&gt; in the menu. The chart wizard will appear on the screen for you to choose the kind of chart that you want to create. Choose the Bar Chart. Click the finish button to display the chart equivalent of the table you selected. Right-click once one of the Running %  bar and choose Chart Type in the menu that appears. The Chart Type window will pop out and then you can change Running % from bar to line type. The chart should look like the screen shot below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV5oqIYe1B9ACIbbi56qtGNY54RuNZgvgxumwuk0IWbxfqrZng_WRwOADg0FwTVN_KPJHJmoIqFG0WNWi71VishNKKtUi2Pfkeep3dWWgSnvUvOgy3CNZt2gX6GDiEsXhEy96RCeiaXs_4/s1600-h/pareto-chart2.gif&quot;&gt;&lt;img style=&quot;margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV5oqIYe1B9ACIbbi56qtGNY54RuNZgvgxumwuk0IWbxfqrZng_WRwOADg0FwTVN_KPJHJmoIqFG0WNWi71VishNKKtUi2Pfkeep3dWWgSnvUvOgy3CNZt2gX6GDiEsXhEy96RCeiaXs_4/s400/pareto-chart2.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5231801881531670066&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now you know how to create your own Pareto chart, but you probably have questions at the back of your head right now. And you might be asking the following questions:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I can&#39;t see the 80% and 20% in the chart so why is it called 80-20 rule based?&lt;/li&gt;&lt;li&gt;How this chart can help the business? &lt;/li&gt;&lt;li&gt;How this chart can be applied with a database with large repository of data?&lt;/li&gt;&lt;/ol&gt;I will try to answer these questions the best that I can.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;1. ) I can&#39;t see the 80% and 20% in the chart so why is it called 80-20 rule based?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Answer:&lt;/span&gt; I intentionally made the sample Pareto chart an imperfect one to make it looks like a realistic one.  The 80-20 rule doesn&#39;t mean that exactly 20% of the reasons are 80% of the root causes of losing businesses. It simply states the principle that a few of the reasons causes  the majority of why you are losing, not exactly 20%. That&#39;s why the phrase &quot;the vital few and the trivial many&quot; was coined after this rule.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;2.) How this chart can help the business?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Answer:&lt;/span&gt; Considering the example above, you can easily see that most of the reasons in losing a business are &lt;span style=&quot;font-weight: bold;&quot;&gt;Price&lt;/span&gt; and Customers&#39; &lt;span style=&quot;font-weight: bold;&quot;&gt;Lack of Fund&lt;/span&gt;. The two reasons when combine together have more than 50% and simply means they are major root causes of your loses. Knowing that information, you can focus in those problem areas; you can act and fix on those situations. Once the problems are solved in those areas, you also solved more than 50% of the root causes and surely will improve your business performance and profitability. Then you can generate again another Pareto chart to know if the situation has changed and then focus again in the majority root causes. It is a continuous cycle of knowing the big problems and solving them.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;3. How this chart can be applied with a database with large repository of data?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Answer: &lt;/span&gt;This is the most important part of our discussion. In your company, you surely have a lot of records sitting in your Excel files, Access files, SQL Server, Oracle, etc. How can we use them to create a Pareto chart.&lt;br /&gt;&lt;br /&gt;Our example above is very simple that you don&#39;t need to convert it to Pareto chart to know what are the majority of the problems. But imagine, for example,  if you have many branches, let&#39;s say 30 branches with 10 sales persons each that have multiple prospective customers and they are recording those leads pipeline in Excel to monitor quote status, amount, products, etc. Do you think you can easily come up with a Pareto chart with many Excel files in different locations? No, it&#39;s not that easy to consolidate those data. You need to have a procedure in implementing the consolidation and a good Excel macro program to automate the stitching of the records.&lt;br /&gt;&lt;br /&gt;Another good example is: you are in a manufacturing company and having an ERP system. You want to create a Pareto chart because you want to know from which of the 60,000 raw materials that take most of your inventory investments. It is because you want to focus on them to make sure that majority of your investment is taken care of by keeping an eye on the correct reorder point, correct stock handling, good supplier selection, proper purchasing approval, etc. And with it, you can delegate the &quot;trivial many&quot; to your subordinates.&lt;br /&gt;&lt;br /&gt;In my subsequent posts, I will demonstrate to you a different methods of how to export to excel records from different platforms (mostly with VBA programming); flat file, Excel, Access, SQL Server (OLAP or not) and Oracle. It will be a series of posts as I can not tackle them all in a sigle posting.&lt;br /&gt;&lt;br /&gt;Subscribe now. You can see below how.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/08/pareto-chart-example.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJaAQaFlPtRholwaZ1BIKPIoe6Cwn90Yg8WFG9WS49n2nmfOuKl7rEPFicXfZYcnrpk6EtJcMypsLwRVOh0ZE94avELgmzt66RdYpIxHB-0N0FQ0e6V1lVa92LokOFAJHuhL-NDfy3awB4/s72-c/pareto-chart1.gif" height="72" width="72"/><thr:total>6</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-290074208248858519</guid><pubDate>Sun, 03 Aug 2008 01:56:00 +0000</pubDate><atom:updated>2008-08-08T00:04:27.920+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Decision Support System</category><category domain="http://www.blogger.com/atom/ns#">Pareto Chart Analysis</category><title>Pareto Chart</title><description>The &lt;span style=&quot;font-weight: bold;&quot;&gt;Pareto Chart&lt;/span&gt;, also known as the Pareto Analysis, ABC Analysis, or 80-20 Analysis, is based on the principle of &quot;the vital few and trivial many&quot; developed by &lt;a href=&quot;http://en.wikipedia.org/wiki/Vilfredo_Pareto&quot;&gt;Vilfredo Pareto&lt;/a&gt;, an Italian economist born in 1848. I&#39;m not going to discuss here his life; you can already research on that in &lt;a href=&quot;http://en.wikipedia.org/wiki/Vilfredo_Pareto&quot;&gt;Wikipedia&lt;/a&gt; or Google. What you will read here is about the importance of his statistical findings, the 80-20 rule, that you can apply in almost every aspect of your life, especially in business. And in business, I will give you an example in my next post on how can you make the Pareto chart as a decision support tool by digging and using the data that you already have in your existing database. Yes, the raw data residing in your database, whether it&#39;s an Excel data, MS Access data, OLAP data, SAP data, or Oracle data, are just sitting there waiting to be dug up and be transformed to an information that will greatly help you to improve your business focus, operation, and eventually profitability.&lt;br /&gt;&lt;br /&gt;The 80-20 rule means that approximately 20% of everything is either better or worse than the 80%. For example, 20% of your retail products are making 80% of your profitability. 20% of your sales agents are giving the 80% of the total sales. And here&#39;s a more enlightening; in an equally managed inventory of raw materials, 80% of your inventory investment goes to a certain small group of products that need more attention than the 20% that you can delegate to someone else. There are actually limitless applications to this theory. All you have to do is think outside the box and hard.&lt;br /&gt;&lt;br /&gt;In the next post, the example I promised you will be discussed and in the subsequent posts thereafter, the different way to extract data from different sources (Flat file, Access, SQL Server, SAP and Oracle E-Business Suite) will be discussed. So be in the loop. Subscribe now. You&#39;ll see below how.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/08/pareto-chart.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-4062903524464683310</guid><pubDate>Sun, 25 May 2008 09:42:00 +0000</pubDate><atom:updated>2008-05-25T20:57:05.511+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Data Entry Form</category><category domain="http://www.blogger.com/atom/ns#">Vendor Information Management</category><title>Excel Data Entry Form</title><description>Here is a simple way to make your Excel worksheet as a simple database. In our example, we will create a vendors table and we will use an Excel data entry form to allow user to populate the vendors table. Here&#39;s how to do it...&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Step 1&lt;/span&gt;: Create a new workbook. Rename the first worksheet as &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Vendor&lt;/span&gt;&quot;. It will become the repository of the vendor information that the users will enter to our data entry form.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Step 2&lt;/span&gt;: At the first row, enter the following &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;column&lt;/span&gt;&quot; names...&lt;ul&gt;&lt;li&gt;Vendor ID&lt;/li&gt;&lt;li&gt;Vendor Name&lt;/li&gt;&lt;li&gt;Address 1&lt;/li&gt;&lt;li&gt;Address 2&lt;/li&gt;&lt;li&gt;City&lt;/li&gt;&lt;li&gt;Country&lt;/li&gt;&lt;li&gt;Zip&lt;/li&gt;&lt;li&gt;Phone 1&lt;/li&gt;&lt;li&gt;Phone 2&lt;/li&gt;&lt;li&gt;Fax&lt;/li&gt;&lt;li&gt;Contact&lt;/li&gt;&lt;/ul&gt;Here&#39;s how the worksheet should look when you enter them:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdWb4J2sj48PpyUQwBHVjlzHUE2bMbQs7aSGeY2GS63lXVir820mvVJgpL3HwlFgHHSuSqSKENYDDVyWO_Cdu5UG97GSIwWvvo1enfZNnNHBT0DzR7d8pQYhAp0T6XTFWzBEDy01ZNZIZ4/s1600-h/excel-data-entry-form-1.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdWb4J2sj48PpyUQwBHVjlzHUE2bMbQs7aSGeY2GS63lXVir820mvVJgpL3HwlFgHHSuSqSKENYDDVyWO_Cdu5UG97GSIwWvvo1enfZNnNHBT0DzR7d8pQYhAp0T6XTFWzBEDy01ZNZIZ4/s400/excel-data-entry-form-1.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5204265862027097618&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;These &quot;column&quot; names are just example of what you can put in a vendor table. You can add your own columns or delete some that you think you don&#39;t need in your own application.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Step 3&lt;/span&gt;: Select all the cells of the column names.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Step 4&lt;/span&gt;: At the menu, click &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Data&gt;Form&lt;/span&gt; as seen in the screen shot below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9TyD0hZ0ZNvbUnetDkrzjgrm79L5mLevRmlFahYyKBvQPDC-qFuqjFc_mU-jRZHGQf3EaTudZiRgM-p3hmNb6rjZjGryc7yQefGwit9QVnlD2jP6NEC6YRy46LEBH4YxVL8y4dPVkOFUO/s1600-h/excel-data-entry-form-2.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9TyD0hZ0ZNvbUnetDkrzjgrm79L5mLevRmlFahYyKBvQPDC-qFuqjFc_mU-jRZHGQf3EaTudZiRgM-p3hmNb6rjZjGryc7yQefGwit9QVnlD2jP6NEC6YRy46LEBH4YxVL8y4dPVkOFUO/s400/excel-data-entry-form-2.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5204271703182620194&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;You will be prompted with multiple questions; but your answer should be to make the first  row of the highlighted cells as the columns (or labels). This question is only when the excel database has no records in it. The next time, when there are already records in it, this will not appear. The &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Ok&lt;/span&gt;&quot; button should be pressed at this point.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Step 5&lt;/span&gt;: The Excel data entry form is now in front of you. Here&#39;s how it looks...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyiWDnAexxZbI6Eauo7EG81MyjwVaFQmqLrR1vXdtbNjleHFlBYeD7js3jzi0oxdlY9DJqf_8uG49mkxUAUwMusiVdyxr-CzIX91LyscAHc-p8MJmKoFunEu705E-CjHoh1oQh3siVBiKJ/s1600-h/excel-data-entry-form-3.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyiWDnAexxZbI6Eauo7EG81MyjwVaFQmqLrR1vXdtbNjleHFlBYeD7js3jzi0oxdlY9DJqf_8uG49mkxUAUwMusiVdyxr-CzIX91LyscAHc-p8MJmKoFunEu705E-CjHoh1oQh3siVBiKJ/s400/excel-data-entry-form-3.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5204276071164360242&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Step 6&lt;/span&gt;: Like a usual data entry form, there are things that you can do with the form. To enter a new record, enter the information in each field and click the &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;New&lt;/span&gt;&quot; button. &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Delete&lt;/span&gt;&quot; button is used to delete a record. &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Restore&lt;/span&gt;&quot; button is used to restore previous content of the fields when you amend the fields. &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Find Prev&lt;/span&gt;&quot;, &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Find Next&lt;/span&gt;&quot; and &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Criteria&lt;/span&gt;&quot; are for records navigation. I have to say that most of the time the &quot;Criteria&quot; is not functioning well or maybe I was doing something wrong to make it act unusual.&lt;br /&gt;&lt;br /&gt;So that&#39;s how to go through the &lt;span style=&quot;font-weight: bold;&quot;&gt;Excel data entry form&lt;/span&gt;. This small database management is should be enough for small needs, but as the needs grow new methods are should be used instead of this. In the upcoming posts in the near future, I will discuss other ways to do that. not all in a single post, but in a subsequent series of posts.&lt;br /&gt;&lt;br /&gt;You better subscribe now. See below how...&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/excel-data-entry-form.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdWb4J2sj48PpyUQwBHVjlzHUE2bMbQs7aSGeY2GS63lXVir820mvVJgpL3HwlFgHHSuSqSKENYDDVyWO_Cdu5UG97GSIwWvvo1enfZNnNHBT0DzR7d8pQYhAp0T6XTFWzBEDy01ZNZIZ4/s72-c/excel-data-entry-form-1.jpg" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-5415227012628188756</guid><pubDate>Thu, 15 May 2008 10:00:00 +0000</pubDate><atom:updated>2008-05-16T00:49:53.358+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Checking Excel File</category><category domain="http://www.blogger.com/atom/ns#">Excel Password Protection</category><title>Checking Excel&#39;s Filename</title><description>This is an improvement of my previous post. It always happens to me that whenever I put a password protection in my Excel/VBA program, I need to hide to the regular users not just the confidential data or customized menu, but the password window also should not displayed so that they will not have the idea that the file has a confidential information or has features that they shouldn&#39;t see.&lt;br /&gt;&lt;br /&gt;This is a simple trick that I&#39;ve been using for years. Open the program that we did in the last post and change code in &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Open&lt;/span&gt; event in the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;ThisWorkbook&lt;/span&gt; object as indicated below:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&#39;this is the original code&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_Open()&lt;br /&gt;PasswordOk = False&lt;br /&gt;frmPassword.Show&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&#39;change it to this one&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_Open()&lt;br /&gt;PasswordOk = False&lt;br /&gt;If Left(ThisWorkbook.Name, 5) = &quot;SYSAD&quot; Then&lt;br /&gt;   frmPassword.Show&lt;br /&gt;End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;As you can see the program simply checks the filename of the Excel file if it is prefixed by the word &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;SYSAD&lt;/span&gt;&quot;. If it is, it will prompt for the password, otherwise, it loads just like an ordinary Excel file.&lt;br /&gt;&lt;br /&gt;To ordinary users of the file you can just send to them a copy of the file without the prefix &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;SYSAD&lt;/span&gt;&quot;. To all users that needs to have access to the protected worksheet and customized menu, you can send to them the file with &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;SYSAD&lt;/span&gt;&quot;.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/checking-excels-filename.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-6003280310337399767</guid><pubDate>Tue, 13 May 2008 10:00:00 +0000</pubDate><atom:updated>2008-05-13T21:29:17.490+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Password Protection</category><title>Excel Password Protection - Part 4</title><description>There are situations that you need to hide a customized menu or to make worksheets read only from certain users that need your Excel file for informational purposes only and they shouldn&#39;t mess around with the important or confidential data in the worksheets.&lt;br /&gt;&lt;br /&gt;This is the final post of the 4-part article about Excel Password Protection. We&#39;ll discuss here how to create a VBA program to make your worksheets and customized menu safe from unauthorized users. Just follow the steps below:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Step 1&lt;/span&gt;: From the &lt;a href=&quot;http://msexcelvba.blogspot.com/2008/05/create-customize-excel-menu.html&quot;&gt;previous post&lt;/a&gt;, open the file that we created. It should have the menu program that we entered in it. Open the VBE (you should know it by now or read the previous post, &lt;a href=&quot;http://msexcelvba.blogspot.com/2008/05/create-customize-excel-menu.html&quot;&gt;click here&lt;/a&gt; to learn about it).&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Step 2&lt;/span&gt;: Create a new user form by clicking &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Insert&gt;UserForm&lt;/span&gt;. The user looks like the screen shot below. It&#39;s the UserForm1. Beside it you&#39;ll see the Toolbox menu. It is used to put controls inside the form like a button,  label and a text field.&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrsAJ5t8K0nPkC7Ekg4CJWM6O7fuJW6LdeqmMOOMMbW8Jaf7tBCaYQEXrTNn4FjXn2HcBiSrPDjubjXa1ypCx_Ar9-BSU5WesxRfD0EhaOd9aa79_zZgfwdv-Jbqd1HOqeg82k66xfFyaa/s1600-h/excel-password-protection-4a.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrsAJ5t8K0nPkC7Ekg4CJWM6O7fuJW6LdeqmMOOMMbW8Jaf7tBCaYQEXrTNn4FjXn2HcBiSrPDjubjXa1ypCx_Ar9-BSU5WesxRfD0EhaOd9aa79_zZgfwdv-Jbqd1HOqeg82k66xfFyaa/s400/excel-password-protection-4a.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5199343211612563154&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Step 3&lt;/span&gt;: Open up the properties window by clicking &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;View&gt;Properties Window&lt;/span&gt; or by pushing &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;F4&lt;/span&gt; key. The properties window looks like the figure below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGylgPSMk64vVFAX_f5lE0v-gWsxVJbzIBeHzaqxOuLP3dIeK9uBjqBl0kiOXEvCzx2WSQ_BcVBJZpzaGD-1XGhi46NoYEI-oWIZQO1OBVjkINrC5uP7y_dy2bO5bbOBCoOsP5yoetzBti/s1600-h/excel-password-protection-4b.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGylgPSMk64vVFAX_f5lE0v-gWsxVJbzIBeHzaqxOuLP3dIeK9uBjqBl0kiOXEvCzx2WSQ_BcVBJZpzaGD-1XGhi46NoYEI-oWIZQO1OBVjkINrC5uP7y_dy2bO5bbOBCoOsP5yoetzBti/s400/excel-password-protection-4b.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5199348717760636642&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Step 4&lt;/span&gt;: Click the new user form so that the properties window will show the form&#39;s properties. Inside that properties window, change the following form properties:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Name: change it to &quot;frmPassword&quot;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Caption: change it to &quot;Enter Password&quot;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Height: 111&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Width: 210&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;Step 5: From the tool box window, drag and drop one label, textbox and a button to the user form. Once controls are put in the form, change the properties of each according to the values below:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Label&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Name: lblPassword&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Caption: Password&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Width: 42&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Height: 12&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Top: 28&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Left: 24&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Textbox&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Name: txtPassword&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Width: 120&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Height: 18&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Top: 24&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Left: 72&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt; Button&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Name: cmdOk&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Caption: Ok&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Width: 48&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Height: 18&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Top: 60&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Left: 144&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Step 6&lt;/span&gt;:  Create a new module by clicking &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Insert&gt;Module&lt;/span&gt; in the VBE menu. At the new module enter the following code: (copy-paste will do it quick)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&#39;indicator that password is ok or not&lt;br /&gt;&#39;true = ok, false is not&lt;br /&gt;Public PasswordOk As Boolean&lt;br /&gt;&lt;br /&gt;&#39;temporary storage of the&lt;br /&gt;&#39;password entered by the user&lt;br /&gt;Public strPassword As String&lt;br /&gt;&lt;br /&gt;Sub UnlockSystem(strPW As String)&lt;br /&gt; PasswordOk = False &#39;initialize to false&lt;br /&gt;&lt;br /&gt;  &#39;if password entered is incorrect&lt;br /&gt;  &#39;it will generate an error and&lt;br /&gt;  &#39;will not proceed in menu activation&lt;br /&gt; On Error GoTo MyErr&lt;br /&gt;    Sheet1.Unprotect Password:=strPW&lt;br /&gt;    PasswordOk = True&lt;br /&gt;    strPassword = strPW&lt;br /&gt;    PutProBusinessMenu&lt;br /&gt; On Error GoTo 0&lt;br /&gt; Exit Sub&lt;br /&gt;MyErr:&lt;br /&gt; MsgBox &quot;Worksheet 1 will remain locked and&quot; &amp;amp; _&lt;br /&gt; &quot; customized menu is hidden.&quot;, , &quot;Invalid Password&quot;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Sub LockSystem()&lt;br /&gt; &#39;this will be used to lock the program&lt;br /&gt; &#39;and disable the customized menu&lt;br /&gt; &#39;when changing workbook and closing the file&lt;br /&gt; If PasswordOk Then&lt;br /&gt;    Sheet1.Protect Password:=strPassword&lt;br /&gt;    ClearProBusinessMenu&lt;br /&gt; End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Step 7&lt;/span&gt;: Go back to the user form and double click the button control in it. The code view for the button is displayed. Enter the following code inside it:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&#39;when the ok button is clicked,&lt;br /&gt;&#39;it runs the UnlockSystem routine&lt;br /&gt;Private Sub cmdOk_Click()&lt;br /&gt; UnlockSystem txtPassword.Text&lt;br /&gt; Unload Me&lt;br /&gt;End Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Step 8&lt;/span&gt;: Finally change the code of the entire &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;ThisWorkbook &lt;/span&gt;object and put the following code:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Private Sub Workbook_Activate()&lt;br /&gt;  &#39;if a workbook is activated,&lt;br /&gt;  &#39;it will unlock the system if password&lt;br /&gt; &#39;previously entered was correct&lt;br /&gt; If PasswordOk Then&lt;br /&gt;    UnlockSystem strPassword&lt;br /&gt; End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_BeforeClose(Cancel As Boolean)&lt;br /&gt;  ;lock again the system before closing&lt;br /&gt; LockSystem&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_Deactivate()&lt;br /&gt;  &#39;locking the system when workbook is deactivated.&lt;br /&gt; LockSystem&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_Open()&lt;br /&gt;  &#39;when the file is open, it prompts for the&lt;br /&gt;  &#39;password&lt;br /&gt; PasswordOk = False&lt;br /&gt; frmPassword.Show&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-weight: bold;&quot;&gt;Step 9&lt;/span&gt;: Lastly, lock the first sheet of your excel file (the one that has the object name of Sheet1) using any password that you want. The same password will be used to unlock it and enable the menu.&lt;br /&gt;&lt;br /&gt;There you go. try to run the program by closing the file and reopen it. The file will ask for the password. If the correct password is entered, you will see the customized menu and the worksheet is unlocked. Otherwise, menu and worksheet is locked.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/excel-password-protection-part-4.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrsAJ5t8K0nPkC7Ekg4CJWM6O7fuJW6LdeqmMOOMMbW8Jaf7tBCaYQEXrTNn4FjXn2HcBiSrPDjubjXa1ypCx_Ar9-BSU5WesxRfD0EhaOd9aa79_zZgfwdv-Jbqd1HOqeg82k66xfFyaa/s72-c/excel-password-protection-4a.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-7588971120355859038</guid><pubDate>Sun, 11 May 2008 11:02:00 +0000</pubDate><atom:updated>2008-05-12T12:10:27.710+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Customize Excel Menu</category><title>Create Customize Excel Menu</title><description>I have to apologize that I put off the supposedly next password article for this one. I must discuss this one first because the next password article will need this program module routines. I will be discussing here how to create a customize menu that we can insert in the existing Excel menu. The menu can be used in your program applications in many ways so it is something that you should know when developing Excel programs.&lt;br /&gt;&lt;br /&gt;So let&#39;s get started to create our own customized menu.&lt;br /&gt;&lt;br /&gt;Step 1: Open you Excel file and run the Visual Basic Editor (VBE) by clicking Tools&gt;Macro&gt;Visual Basic Editor.&lt;br /&gt;&lt;br /&gt;Step 2: When VBE appears, add a new module by clicking Insert&gt;Module at the VBE menu.&lt;br /&gt;&lt;br /&gt;Step 3: At the new module, enter the following code snippets:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub PutProBusinessMenu()&lt;br /&gt;    Dim cmdControl As CommandBarControl&lt;br /&gt;    Dim cmdbarMenu As CommandBar&lt;br /&gt;    Dim cmdControlMenu As CommandBarControl&lt;br /&gt;    Dim intHelpMenuItem As Integer&lt;br /&gt;&lt;br /&gt;    ClearProBusinessMenu&lt;br /&gt;&lt;br /&gt;    Set cmdbarMenu = _&lt;br /&gt;    Application.CommandBars(&quot;Worksheet Menu Bar&quot;)&lt;br /&gt;     &lt;br /&gt;    intHelpMenuItem = _&lt;br /&gt;    cmdbarMenu.Controls(&quot;Help&quot;).Index&lt;br /&gt;     &lt;br /&gt;    Set cmdControlMenu = _&lt;br /&gt;    cmdbarMenu.Controls.Add(Type:=msoControlPopup, _&lt;br /&gt;    Before:=intHelpMenuItem)&lt;br /&gt;                  &lt;br /&gt;    cmdControlMenu.Caption = &quot;&amp;amp;Pro-business&quot;&lt;br /&gt;     &lt;br /&gt;    With cmdControlMenu.Controls.Add( _&lt;br /&gt;    Type:=msoControlButton)&lt;br /&gt;        .Caption = &quot;Execute Process&quot;&lt;br /&gt;        .OnAction = &quot;ExecuteProcess&quot;&lt;br /&gt;    End With&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Sub ClearProBusinessMenu()&lt;br /&gt;    On Error Resume Next&lt;br /&gt;    Application.CommandBars(&quot;Worksheet Menu Bar&quot;). _&lt;br /&gt;    Controls(&quot;&amp;amp;Pro-business&quot;).Delete&lt;br /&gt;    On Error GoTo 0&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Sub ExecuteProcess()&lt;br /&gt;    MsgBox &quot;Process is executed.&quot;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The first snippet is about creating the menu before the Help option. The second one is deleting it from the menu. You need the second snippet to clear your own menu when the file is closed or when the user move from your workbook to another workbook that doesn&#39;t use your program. The next step is about doing that.&lt;br /&gt;&lt;br /&gt;The last snippet is the module to be executed when the option in our new menu is executed. This part is where you put your own code when you want to use this program in your own application.&lt;br /&gt;&lt;br /&gt;Step 4: Click ThisWorkbook item in the Project window at the left side of your VBE. When the ThisWorkbook module opens up and enter the following code snippets.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Private Sub Workbook_Activate()&lt;br /&gt;    PutProBusinessMenu&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub Workbook_Deactivate()&lt;br /&gt;    ClearProBusinessMenu&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Step 5: Save your Excel file, close it and try to open it again. You will see that you have the new menu right before the Help in the main menu. Open up another Excel file and try to switch between our Excel file and the other one. You will see that the menu appears only when our Excel file is active.&lt;br /&gt;&lt;br /&gt;That&#39;s how to do it. Next time, as promised, the Excel password protection for your Excel and VBA program. We will put a password protection to this customized menu and we will discuss so much more about Excel program security.&lt;br /&gt;&lt;br /&gt;Subscribe now to see the next topic by clicking the link below:&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/create-customize-excel-menu.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-7248129893447396309</guid><pubDate>Fri, 09 May 2008 13:31:00 +0000</pubDate><atom:updated>2008-05-10T00:01:25.003+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Password Protection</category><title>Excel Password Protection - Part 3</title><description>In our 2 previous posts, Excel Password Protection &lt;a href=&quot;http://msexcelvba.blogspot.com/2008/05/excel-password-protection-part-1.html&quot;&gt;Part 1&lt;/a&gt; &amp;amp; &lt;a href=&quot;http://msexcelvba.blogspot.com/2008/05/excel-password-protection-part-2.htm&quot;&gt;Part 2&lt;/a&gt;, we tackled 2 ways to protect your Excel spreadsheets. The first part was about protecting the Excel file itself. The second was about security at the worksheet level.&lt;br /&gt;&lt;br /&gt;We are now in the third part of Excel Password Protection series. It&#39;s time discuss how to give security to your valued source code. Here are the steps:&lt;br /&gt;&lt;br /&gt;1.) Open your Excel file with the VBA program. Load the VBE from the menu by clicking &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Tools&gt;Macro&gt;Visual Basic Editor&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;2.) At the VBE menu, click &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Tools&gt;VBAProject Properties&lt;/span&gt; and the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Protection&lt;/span&gt; tab. Its window look like the screen shot below:&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSZChmNoIgkKZ4G-hf2kTyHrv97ooaPpnxYy5uZNQ_3lcWfsVmy7gSVc5FzLcJFVsrJ8UzBiwgeU1ZlXjeG5U1jQj7ywVWa5zM_x0_SmTF1Fm3HG585klCFoTsYy7v6qK3y_uSQoxIVYPR/s1600-h/excel-password-protect-3a.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSZChmNoIgkKZ4G-hf2kTyHrv97ooaPpnxYy5uZNQ_3lcWfsVmy7gSVc5FzLcJFVsrJ8UzBiwgeU1ZlXjeG5U1jQj7ywVWa5zM_x0_SmTF1Fm3HG585klCFoTsYy7v6qK3y_uSQoxIVYPR/s400/excel-password-protect-3a.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5198397832830426226&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3.) Tick the checkbox to lock the project&#39;s code for viewing and at the last part of the window, you  need to enter your password in both the &quot;Password&quot; and &quot;Confirm Password&quot; text fields. This is to make sure that you didn&#39;t put in a misspelled one.&lt;br /&gt;&lt;br /&gt;4.) Click OK button&lt;br /&gt;&lt;br /&gt;So that&#39;s it. Isn&#39;t it simple. The next time you open your Excel file and its VBE, you will not see your program unless you enter the right password.&lt;br /&gt;&lt;br /&gt;In this Part 1-3 of Excel Password Protection series, we haven&#39;t done any programming yet, but in the next post, you will learn how to make your own VBA program to protect some portion of your Excel file from unauthorized access, execution or modification. You haven&#39;t seen the best part yet. So you better come back here. Subcribe now for free by &lt;a href=&quot;http://feeds.feedburner.com/MSExcelVBA&quot;&gt;clicking here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;After this password series, I will start to discuss (mostly) about business processes and Excel and VBA can be a good part of them. Right now, I&#39;ve been thinking what to tackle first. I want you, my readers, to help me out on what particular interest most of my readers are into. I want to give what you want, so please help me by voting at the &quot;Poll&quot; section at the right side of this page. The one that has the highest vote will be touched here first.&lt;br /&gt;&lt;br /&gt;Start voting! :)&lt;/blockquote&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/excel-password-protection-part-3.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSZChmNoIgkKZ4G-hf2kTyHrv97ooaPpnxYy5uZNQ_3lcWfsVmy7gSVc5FzLcJFVsrJ8UzBiwgeU1ZlXjeG5U1jQj7ywVWa5zM_x0_SmTF1Fm3HG585klCFoTsYy7v6qK3y_uSQoxIVYPR/s72-c/excel-password-protect-3a.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-7178823716423020892</guid><pubDate>Wed, 07 May 2008 16:03:00 +0000</pubDate><atom:updated>2008-05-08T00:04:43.536+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Password Protection</category><title>Excel Password Protection - Part 2</title><description>In this second post about Excel Password Protection, we will discuss how to protect individual worksheet of an Excel workbook. There are many reasons why sometimes we need to password protect them but most of them are for keeping the content of the worksheet intact and unmodified, or keeping the confidentiality of the content, e.g. formula for profit margin, item cost, etc. from those who shouldn&#39;t be looking at them. Without so much bother, here are the ways to password protect your worksheets.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Making A Worksheet Read-Only&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To protect your worksheet from alteration and to hide all the formula in all the cells by locking them by a password, all you have to do is choose the tab name of the worksheet. Highlight the whole worksheet by clicking the upper left cell header. Then on the menu click &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Format&gt;Cells&lt;/span&gt;. The Format Cells window will appear. Click the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Protection&lt;/span&gt; tab. It looks like the screen grab below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYseGABqHNIP4wPajoOlHvRWg9ELsU8uN0SHqSkZlsCfdqnqgSo_wBuf7fs-7yWqyc2Yc62TgccVJzVjipBaK7-biwR28sSSsqAVOjzgAC7YhPIXXD2KcdgJW1dpbWFDsyxiVcYTJncGN/s1600-h/excel-password-protect-2b.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYseGABqHNIP4wPajoOlHvRWg9ELsU8uN0SHqSkZlsCfdqnqgSo_wBuf7fs-7yWqyc2Yc62TgccVJzVjipBaK7-biwR28sSSsqAVOjzgAC7YhPIXXD2KcdgJW1dpbWFDsyxiVcYTJncGN/s400/excel-password-protect-2b.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197652920931831682&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;There are two checkboxes, the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Locked&lt;/span&gt; and &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Hidden&lt;/span&gt; checkboxes. The Locked is checked by default but the other one is not. The Locked is to make all the cells unmodifiable when you activate the worksheet password protection. The Hidden checkbox is to hide all the formulas of the cells. Check them both.&lt;br /&gt;&lt;br /&gt;The next step is to activate the sheet protection. Go to &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Tools&gt;Protection&gt;Protect Sheet&lt;/span&gt;. You will see the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Protect Sheet&lt;/span&gt; window as seen below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoic26-q42y4JSmW171j96AeE8nKblb5KVxusLpwNcq8-t8f4gEUflYRFujq1KHn1fftgz6Vm8oxX5HmE4d69JCvkgQ0jYrgR3jO25Ebr00dBWJh-NMe34HpfV5tvhG6ZIzP0is8dSXe0H/s1600-h/excel-password-protect-2c.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgoic26-q42y4JSmW171j96AeE8nKblb5KVxusLpwNcq8-t8f4gEUflYRFujq1KHn1fftgz6Vm8oxX5HmE4d69JCvkgQ0jYrgR3jO25Ebr00dBWJh-NMe34HpfV5tvhG6ZIzP0is8dSXe0H/s400/excel-password-protect-2c.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197656245236518802&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;The first checkbox you see should be checked to make the security active. The textbox below it is for the password. It is actually optional but what&#39;s the use of locked sheet without a password. Anyone can undo the protection when there&#39;s no password. So, you should put your password for total guarantee that it&#39;s safe.&lt;br /&gt;&lt;br /&gt;Below the textbox, you can see a set of checkboxes. Most of the time, I didn&#39;t change the default value of them but there&#39;s no harm in exploring it. You can experiment on different combinations that you think appropriate to your needs.&lt;br /&gt;&lt;br /&gt;When done, push the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Ok&lt;/span&gt; button to complete the operation. Your worksheet is now read-only protected.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Making Other Cells Unlocked And Changeable&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;At the above procedure, you locked all the cells and made them unchangeable. But if you need to leave other cells in the worksheet unlock and available for user to alter them, it is also possible to do that. After locking all the cells, you can choose the cells that you want to be kept changeable and highlight them. Click again the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Format&gt;Cells&lt;/span&gt; at the menu. Choose the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Protection&lt;/span&gt; tab. Uncheck the Locked checkbox and click &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Ok&lt;/span&gt; button. Activate the sheet protection.&lt;br /&gt;&lt;br /&gt;Maybe you are asking, &quot;Why do I have to do that; leaving other cells changeable?&quot;. At this level of discussion, it doesn&#39;t look like it make sense. Doesn&#39;t it? Allow me to give you an example. Let&#39;s say, you are making a data entry for a Purchasing Order form. You create a template of the form in Excel and you want the user or the buyer to use that Excel file to create the PO form for the company purchases. At this scenario, you can lock the sheet for the PO entry form to protect the layout from accidental changes and leaving only those fields for the entry of PO number, vendor, payment terms, delivery date, etc. open for user encoding. Do you get the idea?&lt;br /&gt;&lt;br /&gt;There are so many things that you can do with the functions. The example I gave above is just one of them and it&#39;s a very simple one. Different applications with this is only a matter of how you use your imagination and creativity. I&#39;m sure, you can think of something that you can do with it in you job or business.&lt;br /&gt;&lt;br /&gt;Next post will be about Visual Basic protection. So keep the subscription and stay in the loop. To those who want to subscribe, it&#39;s for free. &lt;a href=&quot;http://feeds.feedburner.com/MSExcelVBA&quot;&gt;Just click here&lt;/a&gt;.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/excel-password-protection-part-2.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWYseGABqHNIP4wPajoOlHvRWg9ELsU8uN0SHqSkZlsCfdqnqgSo_wBuf7fs-7yWqyc2Yc62TgccVJzVjipBaK7-biwR28sSSsqAVOjzgAC7YhPIXXD2KcdgJW1dpbWFDsyxiVcYTJncGN/s72-c/excel-password-protect-2b.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-6632411332777095879</guid><pubDate>Tue, 06 May 2008 13:23:00 +0000</pubDate><atom:updated>2008-05-06T22:39:02.074+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Password Protection</category><title>Excel Password Protection- Part 1</title><description>One of my readers, his name is Stew, requested me to discuss about Excel password protection because I mentioned it in my last post entitled &lt;a href=&quot;http://msexcelvba.blogspot.com/2008/05/advantages-and-disadvantages-of.html&quot;&gt;Advantages And Disadvantages Of Microsoft Excel Database Application&lt;/a&gt;. As I said in that post, there are many ways to protect your Excel file. I can not tackle everything in one post, so consider this as the first part of series of articles about Excel password protection. I put off for a while my topic on how to develop Excel database application to give way to this one.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold; color: rgb(0, 153, 0);&quot;&gt;Password Protect Your Excel File From Unauthorized Use&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This one is very simple to do. Open an Excel file. If you just created an unsaved new one, save it first before you can set a password into it. Then follow the steps below:&lt;ul&gt;&lt;li&gt;Click &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;File&gt;Save As&lt;/span&gt; in the menu.&lt;/li&gt;&lt;li&gt;On the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Save As&lt;/span&gt; window, click the &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Tools&lt;/span&gt; at the upper right portion of it as shown in the screen shot below:&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJeN8LCiHaiwLTmwyu4MOFrvUFJ8Ej2qJxbvEowaIMJpfryuoDf6uU45kslH2cAFouNvofx7QyTQqdUknZ-1XWIXCE7suitkp6SIVm4LHkxYR8YHKpbRKGk9aqHE6-HydtcTy2ZBOw37oM/s1600-h/Excel-password-protect-part-1-a.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJeN8LCiHaiwLTmwyu4MOFrvUFJ8Ej2qJxbvEowaIMJpfryuoDf6uU45kslH2cAFouNvofx7QyTQqdUknZ-1XWIXCE7suitkp6SIVm4LHkxYR8YHKpbRKGk9aqHE6-HydtcTy2ZBOw37oM/s400/Excel-password-protect-part-1-a.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197265935244662194&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;The &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Save Options&lt;/span&gt; window will appear as shown in the figure below. The window prompts for 2 passwords. The password to open the file and another one to allow the user to modify the file. The second one is optional. If it is left blank, Excel assumes that the first password is for both opening and modification. If the second password is provided, it will ask for a second password when you open the file. If the second file is not entered on opening, the file is in read-only mode.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJovpXFRoKRyOifQzToYGm3bryHJN1mDPadcqB5EvlAX5lHfHsFXyjfM62zuGLbPJCh8fvLrJVXfodRDXu3kfD-yDMr5aDA_NLgHagwKX0FHyGappRAwNeOmBTkSEjcxtpoN1IrE7Qjyak/s1600-h/Excel-password-protect-part-1-b.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJovpXFRoKRyOifQzToYGm3bryHJN1mDPadcqB5EvlAX5lHfHsFXyjfM62zuGLbPJCh8fvLrJVXfodRDXu3kfD-yDMr5aDA_NLgHagwKX0FHyGappRAwNeOmBTkSEjcxtpoN1IrE7Qjyak/s400/Excel-password-protect-part-1-b.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197268838642554306&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;There are two checkboxes, the &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Always create backup&lt;/span&gt;&quot; checkbox makes your Excel file to create a backup whenever you modified the file. The next one is &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Read-only recommended&lt;/span&gt;&quot; checkbox that prompts you if you want to open it as a read-only or not.&lt;/li&gt;&lt;li&gt;The best part of this Excel password protection is that you can tighten your security even more by having a strong encryption method for your password. You can do that by clicking the &quot;&lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Advanced&lt;/span&gt;&quot; button. You will see &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;Encryption Type&lt;/span&gt; window and choose the encryption type that you want. It looks like this:&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilGWJmglEluPUlc2et6IfNOFmE0HYeQUQmkBXabfuzG5Te7Rwoe3SdtX22eloHGk5EZZlbM3gbKrkJUmqUV0LOxtihY9LCEzF6rvOEdso_VBC6bviRSC1IcHQfI2gJbg3L4gb7Dix98LY8/s1600-h/Excel-password-protect-part-1-c.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilGWJmglEluPUlc2et6IfNOFmE0HYeQUQmkBXabfuzG5Te7Rwoe3SdtX22eloHGk5EZZlbM3gbKrkJUmqUV0LOxtihY9LCEzF6rvOEdso_VBC6bviRSC1IcHQfI2gJbg3L4gb7Dix98LY8/s400/Excel-password-protect-part-1-c.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5197272077047895506&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Click the Save button.&lt;/li&gt;&lt;/ul&gt;Next time we will discuss about password protecting your worksheets and cells ranges.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/excel-password-protection-part-1.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJeN8LCiHaiwLTmwyu4MOFrvUFJ8Ej2qJxbvEowaIMJpfryuoDf6uU45kslH2cAFouNvofx7QyTQqdUknZ-1XWIXCE7suitkp6SIVm4LHkxYR8YHKpbRKGk9aqHE6-HydtcTy2ZBOw37oM/s72-c/Excel-password-protect-part-1-a.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-3969379999097865840</guid><pubDate>Sun, 04 May 2008 12:14:00 +0000</pubDate><atom:updated>2008-05-06T07:21:22.783+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Database Application</category><title>Advantages And Disadvantages Of Microsoft Excel Database Application</title><description>Yes, it is possible to make Excel as a database and be able to be a database application just like Access. I am sure that you won&#39;t believe me when I say that anything that you can do with a regular programming language is also possible with Microsoft Excel.&lt;br /&gt;&lt;br /&gt;But of course, there are advantages and disadvantages in using Microsoft Excel as database. What are the advantages?&lt;br /&gt;&lt;ul&gt;&lt;li&gt;First and foremost, if you have the Microsoft Office in your PC, you don&#39;t need anything else to be installed in your computer. You are good to go and can start with your programming straight away.&lt;/li&gt;&lt;li&gt;Second, if you are a beginner, you can easily learn the Excel VBA Programming because you are half familiar with the programming platform that you are going to use, which is Excel.&lt;/li&gt;&lt;li&gt;Third, you can start with small Excel database application and as the need grows especially on records that are getting huge, you can still use the same Excel application and upgrade your database platform from Excel to other high-end databases like Access, SQL Server, Oracle, MySQL, etc.&lt;/li&gt;&lt;li&gt;Fourth, Excel is capable of connecting directly to OLAP databases and can be integrated in Pivot Tables.&lt;/li&gt;&lt;li&gt;Fifth, You don&#39;t need to create a your own financial modules. Excel is rich in financial functions like Fixed Assets Depreciation, Amortization, etc.&lt;/li&gt;&lt;li&gt;Sixth, Excel is portable. You can send it to someone through email.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Excel database application also has its disadvantages. But these disadvantages are sometimes have some workaround that can be done to fix or sometimes there are little effect that you can just live with them. Here are the disadvantages:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;When you develop your application into one file it can be huge and will make your program execution very slow. But as I told you, there are workarounds. Design your program to have compact codes to lessen the bloating of the file. Another way is to separate each application function into more than one files. For example, if you are going to design a purchasing program, you can separate each of them; the purchase requisition function, item-and-price comparison matrix function, vendor master list maintenance, item master list maintenance, purchase order function, etc. Each will have small file, therefore execution is faster.&lt;/li&gt;&lt;li&gt;When you separate functions to multiple files, Excel files are prone to get lost in your hard drive especially when you break your application to too many files. You should practice a good folders/sub-directories management.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Excel worksheet as a database has a limited number of rows or records that you can store. But when you reach the 65k lines limit, you can convert it easily to Access and the rest of the application is can still be used.&lt;/li&gt;&lt;li&gt;If you can send Excel via email, you can accidentally send your file to someone who should not have it or not authorized to have it. Solution? You can password protect your Excel file. You can do it in two ways. First, Excel is capable of password protection in many ways (I will also discuss that in the future).  Second, you can create your own password protection by Macro/VBA programming.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So far there are only 4 disadvantages that I can think of. Of course, some of you has something to say about an Excel as a database application, either positive or negative. But one thing is for sure, if it is a negative one, there is always a solution and you can always do something to fix it.&lt;br /&gt;&lt;br /&gt;In subsequent posts, I will give some examples on how to create Excel database application. Everything can not be touched in one writing so it can be a series of posts that you should follow. To be informed of subsequent posts, subscribe to this blog. It&#39;s for free and can be done in a few seconds. Just click any of the subscription method on the upper right part of this webpage or just &lt;a href=&quot;http://feeds.feedburner.com/MSExcelVBA&quot;&gt;click here&lt;/a&gt;.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/05/advantages-and-disadvantages-of.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>6</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-3781248153980930470</guid><pubDate>Tue, 29 Apr 2008 13:00:00 +0000</pubDate><atom:updated>2008-04-29T21:31:47.454+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Excel Form Controls</category><category domain="http://www.blogger.com/atom/ns#">Simple Tips</category><title>Resizing Excel Radio Button&#39;s Font</title><description>Someone asked me today on how to change the size of radio button&#39;s font. In this kind of situation, the first thing that comes to mind is to use the font resizing function for the cells. But, you can not use it to a form control like the radio button.&lt;br /&gt;&lt;br /&gt;To change the font size of a form control, right click on the radio button and choose &quot;Properties&quot; in the pop-up menu that appears. The properties window will be displayed as shown in the screen shot below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWR0zmmDcX96P1z7_hkw0VALLykGxYxN4Pm8eX_oa9xquAPXoM1cA06a1dwEdqnP_ijfEbc9XD-mYFWOeiw8csNqyLxtjqs8SuxCfLNIRSRXNvMuHgXyDfKWJfD_gEAIDIeVSBt4vsWFvh/s1600-h/excel-radio-button.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWR0zmmDcX96P1z7_hkw0VALLykGxYxN4Pm8eX_oa9xquAPXoM1cA06a1dwEdqnP_ijfEbc9XD-mYFWOeiw8csNqyLxtjqs8SuxCfLNIRSRXNvMuHgXyDfKWJfD_gEAIDIeVSBt4vsWFvh/s400/excel-radio-button.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5194656514979075474&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;Click the 3-dot button at the rightmost portion of the &quot;Font&quot; property. The font window will appear and therefore you can change the radio button&#39;s font. The font window looks like the following figure:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1pJ03sNrBgvTACuu80JKN0a0ZHI4uzQ7lXwF9nNtC26YSnnJB-jexBHADx-B4GU1hKAyjWPPKPZHa92Aoh1WvNrwZWZCwJSe1kdfU2Tlfg423HPcaii7l_-iPU6S7VpNo8iGv02gjkNZ-/s1600-h/excel-radio-button-2.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1pJ03sNrBgvTACuu80JKN0a0ZHI4uzQ7lXwF9nNtC26YSnnJB-jexBHADx-B4GU1hKAyjWPPKPZHa92Aoh1WvNrwZWZCwJSe1kdfU2Tlfg423HPcaii7l_-iPU6S7VpNo8iGv02gjkNZ-/s400/excel-radio-button-2.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5194658417649587618&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;After choosing the size you desire, click the &quot;Ok&quot; button.&lt;br /&gt;&lt;br /&gt;You&#39;re done.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/04/resizing-excel-radio-buttons-font.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWR0zmmDcX96P1z7_hkw0VALLykGxYxN4Pm8eX_oa9xquAPXoM1cA06a1dwEdqnP_ijfEbc9XD-mYFWOeiw8csNqyLxtjqs8SuxCfLNIRSRXNvMuHgXyDfKWJfD_gEAIDIeVSBt4vsWFvh/s72-c/excel-radio-button.gif" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-1881499328993338160</guid><pubDate>Mon, 28 Apr 2008 04:00:00 +0000</pubDate><atom:updated>2008-05-07T07:00:00.813+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Business / Financial</category><category domain="http://www.blogger.com/atom/ns#">Currency Conversion</category><category domain="http://www.blogger.com/atom/ns#">Forex</category><category domain="http://www.blogger.com/atom/ns#">Web Query</category><title>Cursos De Forex: Automatic Currency Conversion Calculator In Excel</title><description>&lt;span style=&quot;font-weight: bold;&quot;&gt;Scenario:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You have a spreadsheet that has amount in US Dollar and you need to convert it to other currency. The conversion should be done automatically whenever the workbook is open. The currency rate should be based on the latest conversion rate. As an example, let&#39;s say the conversion would be from US Dollar to Singaporean Dollar. How can we do this?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In this situation, we are going to use a web query to capture the current currency rate in the Internet and the &quot;open event&quot; whenever the spreadsheet is open. In this case, we will use the &lt;a href=&quot;http://finance.yahoo.com/currency&quot;&gt;Yahoo Finance Currency Conversion Calculator&lt;/a&gt; to provide us the most updated rate that we need.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic; font-weight: bold;font-size:130%;&quot; &gt;Here are the step-by-step instructions on how to go about it:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;1.) Create a new workbook and rename the first worksheet as &quot;Amount&quot;. Rename the second as &quot;Currency Rate&quot;.&lt;br /&gt;&lt;br /&gt;2.) Open your browser and go to Yahoo Finance Currency Conversion Calculator by clicking this: &lt;a href=&quot;http://finance.yahoo.com/currency&quot;&gt;http://finance.yahoo.com/currency&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;3.) In the &quot;Currency Converter&quot;, Put 1 in the TextBox, then choose &quot;US Dollar&quot; in the first dropdown list and Singapore Dollar in the second one as shown in the figure below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN11GDzg9w-gm5rC4Q9nr6kBOgT9nvuj6FeMUaxhyphenhyphenG1eJjLxnB8jx-qjcywO1AwxG_s7Lh7dkA94Nyo7si4x-2kysKjSVQFhTg2GGbDwK-fp_wnJ5BX7PuZ6YSHwuXHHdtaxx0NcME4jqD/s1600-h/currency-conversion-calculator.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN11GDzg9w-gm5rC4Q9nr6kBOgT9nvuj6FeMUaxhyphenhyphenG1eJjLxnB8jx-qjcywO1AwxG_s7Lh7dkA94Nyo7si4x-2kysKjSVQFhTg2GGbDwK-fp_wnJ5BX7PuZ6YSHwuXHHdtaxx0NcME4jqD/s400/currency-conversion-calculator.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5194291528658261314&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4.) Click the &quot;Convert&quot; button. Yahoo will display the currency conversion rate of the current date as shown below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH-QqjLM3f4Q-OLkHx6v8IzbIZHkGeVA-JFm2FmTsmw5eip_FA_5zEMzMtDMNwQ6nNpbOKauTflUclB6ggzz0mR4Q6E_J3slHGqbndnrE90pMUefFjQtTnqQ4U5OBL3bWZ534d4oRJUM8T/s1600-h/currency-conversio-calculator-2gif.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH-QqjLM3f4Q-OLkHx6v8IzbIZHkGeVA-JFm2FmTsmw5eip_FA_5zEMzMtDMNwQ6nNpbOKauTflUclB6ggzz0mR4Q6E_J3slHGqbndnrE90pMUefFjQtTnqQ4U5OBL3bWZ534d4oRJUM8T/s400/currency-conversio-calculator-2gif.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5194294075573867858&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;5.) Copy the URL: &lt;span style=&quot;font-size:85%;&quot;&gt;&lt;a style=&quot;color: rgb(51, 204, 0); font-style: italic;&quot; href=&quot;http://finance.yahoo.com/currency/convert?amt=1&amp;amp;from=USD&amp;amp;to=SGD&amp;amp;submit=Convert&quot;&gt;http://finance.yahoo.com/currency/convert?amt=1&amp;amp;from=USD&amp;amp;to=SGD&amp;amp;submit=Convert&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;6.) Going back to Excel, click the &quot;Currency Rate&quot; worksheet tab and place Cell A1 as the active cell. In the menu, click Data&gt;Import External Data&gt;New Web Query. The Excel Web Query will appear and in the &quot;Address&quot; field, put (paste) the URL that you just copied and click the &quot;Go&quot; button. See the screen shot below to know how it looks:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-ICxO0-sfpXKqEktA3RXgpLzZAq3gBh2maGsO2ydqSFyxSMGh6qVzGk6cZ06VdnciUH2qlURa6KW0Y5oxPJvaxJ2ngJJtToeHYtwyGyEZecCQoDSet8BzK961FPV7WZ48GlJMxhRZI-oa/s1600-h/currency-conversio-calculator-3.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-ICxO0-sfpXKqEktA3RXgpLzZAq3gBh2maGsO2ydqSFyxSMGh6qVzGk6cZ06VdnciUH2qlURa6KW0Y5oxPJvaxJ2ngJJtToeHYtwyGyEZecCQoDSet8BzK961FPV7WZ48GlJMxhRZI-oa/s400/currency-conversio-calculator-3.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5194297395583587682&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;7.)  Scroll down the window at the portion where you can see the actual conversion rate of USD to SGD. At the left side of it, you will see a small yellow square with an arrow inside pointing to the right. Click on that yellow square and it will change to green color and the arrow will be changed to a check mark as shown in the figure below:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglLE63orbtfJnHEnNqPKO_mGU_ik8T6E2_nHOdaRIyQ8GNWOhSNBNxMWFCn_MVoz9t3txQ5xoXlsQsCm5fpya8cyz2fXVz485eOQRdpGTu-tw7WXYxZ46BPi_ANoBEkCdf_PhHchWb4gY_/s1600-h/currency-conversio-calculator-4.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglLE63orbtfJnHEnNqPKO_mGU_ik8T6E2_nHOdaRIyQ8GNWOhSNBNxMWFCn_MVoz9t3txQ5xoXlsQsCm5fpya8cyz2fXVz485eOQRdpGTu-tw7WXYxZ46BPi_ANoBEkCdf_PhHchWb4gY_/s400/currency-conversio-calculator-4.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5194300612514092402&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;8.) Click the &quot;Import&quot; button. The &quot;Import Data&quot; window will be displayed as shown below and then click the &quot;Ok&quot; button.&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXtpfh3oMCvFbLQjhU7ScpE6_LTIa_0aotT8fetuLjW43NmbVvjZ_35voGsz1a0YAv1gTwrCKtSVfJqCh77fkICXpUKYvwO8Quu3baT3fh0VFDERWs84-KBfBAL6tpR5FEjYhkzNOlo3SF/s1600-h/currency-conversion-calculator-5.gif&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXtpfh3oMCvFbLQjhU7ScpE6_LTIa_0aotT8fetuLjW43NmbVvjZ_35voGsz1a0YAv1gTwrCKtSVfJqCh77fkICXpUKYvwO8Quu3baT3fh0VFDERWs84-KBfBAL6tpR5FEjYhkzNOlo3SF/s400/currency-conversion-calculator-5.gif&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5194302403515454850&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;9.) The conversion table is now in Excel. Cell E3 has the rate from USD to SGD. Cell C3 has the date of the rate. Click now the &quot;Amount&quot; tab in Excel and put the following in the indicated cells:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;At Cell &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;A1&lt;/span&gt;, write &quot;USD Amount&quot;&lt;/li&gt;&lt;li&gt;At Cell &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;B1&lt;/span&gt;, write &quot;SGD Amount&quot;&lt;/li&gt;&lt;li&gt;At &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;B2&lt;/span&gt;, put the following formula &quot;&lt;span style=&quot;color: rgb(0, 153, 0); font-style: italic;&quot;&gt;=A2*&#39;Currency Rate&#39;!E3&lt;/span&gt;&quot;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;A2&lt;/span&gt; will have the USD Dollar amount to be converted. Initially, let&#39;s put 100 dollar in it.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;10.) Open up the Visual Basic Editor (VBE) and write the following code in &quot;ThisWorkBook&quot; object:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;Private Sub Workbook_Open()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;    Sheets(&quot;Currency Rate&quot;).Select&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;    Selection.QueryTable.Refresh BackgroundQuery:=False&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;    Sheets(&quot;Amount&quot;).Select&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;End Sub&lt;/span&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;That&#39;s all it takes to do it. Whenever you open up the Excel file, it will automatically update the currency rate and eventually the Singapore Dollar amount in Cell B2 in worksheet &quot;Amount&quot;.&lt;br /&gt;&lt;br /&gt;Now that you know this and by using your imagination, you can play around with it and make something useful out of it. You can apply the technique to your financial or business calculation.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/04/cursos-de-forex-automatic-currency.html</link><author>noreply@blogger.com (Unknown)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN11GDzg9w-gm5rC4Q9nr6kBOgT9nvuj6FeMUaxhyphenhyphenG1eJjLxnB8jx-qjcywO1AwxG_s7Lh7dkA94Nyo7si4x-2kysKjSVQFhTg2GGbDwK-fp_wnJ5BX7PuZ6YSHwuXHHdtaxx0NcME4jqD/s72-c/currency-conversion-calculator.gif" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-4580924250366270400</guid><pubDate>Thu, 17 Apr 2008 13:25:00 +0000</pubDate><atom:updated>2008-04-27T08:59:35.108+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MS Word</category><title>TAB Space Adjustment</title><description>I am a little bit off topic with this one but if someone in my office is having this kind of problem then most likely some of the million of users of MS Word around the world are also searching for a way to solve it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Here’s the scenario:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You have many pages, let’s say 30, of enumerated items using “Bullets and Numbering” function of Word having two or more sub-bullets in each bulleted items and you want to change the Tab spacing of one of the particular level of all the bulleted items. If you select each and adjust the spacing one by one, that is a tedious task to do, will take you forever to finish and will probably cause you to make your hands to have carpal tunnel syndrome.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Right click on the items and choose ‘Select Text with similar formatting’. It will highlight them all and you can change the entire tab spacing of items with same formatting at one time.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/04/tab-space-adjustment.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-6839682345294823024</guid><pubDate>Thu, 10 Apr 2008 13:40:00 +0000</pubDate><atom:updated>2008-04-10T21:54:24.465+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Simple Tips</category><title>2 Ways Of Renaming A File In VBA</title><description>Sometimes in your business application programming using VBA, you&#39;ll find yourself in a situation wherein you need to rename a file. Macro Recording at this point will not be helpful as you cannot do the renaming in Excel interactivity. Here are two ways of doing it at a VBA level:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;Sub DoRename()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;Name &quot;c:\test.xls&quot; As &quot;c:\test2.xls&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another way of doing it is by using the  CreateObject function:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: rgb(0, 153, 0);&quot; class=&quot;answerBody quoted&quot; id=&quot;EchoTopic&quot;&gt;Sub DoRename()&lt;br /&gt;Dim fso As Object&lt;br /&gt;Set fso = &lt;span class=&quot;searchTerm&quot;&gt;CreateObject&lt;/span&gt;(&quot;Scripting.FileSystemOb&lt;wbr&gt;ject&quot;)&lt;br /&gt;fso.MoveFile &quot;c:\test.xls&quot;, &quot;c:\test2.xls&quot;&lt;br /&gt;Set fso = Nothing&lt;/div&gt;  &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Another function of this two routines is that it can be used to move a file from folder to another. Here are examples:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;Sub DoMove()&lt;/span&gt;&lt;br /&gt; &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;Name &quot;c:\folder1\test.xls&quot; As &quot;c:\folder2\test.xls&quot;&lt;/span&gt;&lt;br /&gt; &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Moving a file using CreateObject function:&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;color: rgb(0, 153, 0);&quot; class=&quot;answerBody quoted&quot; id=&quot;EchoTopic&quot;&gt;Sub DoRename()&lt;br /&gt;Dim fso As Object&lt;br /&gt;Set fso = &lt;span class=&quot;searchTerm&quot;&gt;CreateObject&lt;/span&gt;(&quot;Scripting.FileSystemOb&lt;wbr&gt;ject&quot;)&lt;br /&gt;fso.MoveFile &quot;c:\folder1\test.xls&quot;, &quot;c:\folder2\test.xls&quot;&lt;br /&gt;Set fso = Nothing&lt;/div&gt;   &lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/04/2-ways-of-renaming-file-in-vba.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-7874554007814414714</guid><pubDate>Tue, 08 Apr 2008 14:49:00 +0000</pubDate><atom:updated>2008-04-08T23:01:16.464+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Simple Tips</category><title>Limit The Worksheet Scrolling</title><description>A few days ago, somebody asked me how to limit the scrolling of a worksheet as soon as he opened his workbook file. He intended to make the first sheet as a Title Page so he should find a way to do it. At first, I thought it was just a simple Excel &quot;setup&quot; workaround at the Tools menu. But after a few minutes of looking around it, I didn&#39;t find a way to do the task (or maybe there was one but I didn&#39;t find it). So, I ended up making a simple Macro program at the workbook&#39;s &quot;Open&quot; event. Here&#39;s how I did it:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;Private Sub Workbook_Open()&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;    Sheets(&quot;Sheet1&quot;).ScrollArea = &quot;a1:f10&quot;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: rgb(0, 153, 0);&quot;&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The code limits the scrolling of the worksheet from cell A1 to F10 only.&lt;br /&gt;&lt;br /&gt;Try it.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2008/04/limit-worksheet-scrolling.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-689574558445016605</guid><pubDate>Mon, 17 Dec 2007 05:58:00 +0000</pubDate><atom:updated>2007-12-17T15:26:53.569+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Firefox</category><title>6 Simple Steps To Speed Up Firefox</title><description>In my other blog &lt;a href=&quot;http://blogging-startup-make-money.blogspot.com/&quot;&gt;Blogging Startup Make Money&lt;/a&gt;, I have discussed how I made my Firefox faster than usual. Please bear with me, but I believe that I don&#39;t have to re-post it here so I will point you to my other blog site for the tips. It&#39;s worth it anyway.&lt;br /&gt;&lt;br /&gt;By the way, If you are not yet using Firefox, this is your chance to get one for&lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt; free&lt;/span&gt; by clicking the orange Firefox button at the lower part of the right sidebar.&lt;br /&gt;&lt;br /&gt;Click here for the tips: &lt;a href=&quot;http://blogging-startup-make-money.blogspot.com/2007/12/6-simple-steps-to-speed-up-firefox.html&quot;&gt;6 Simple Steps To Speed Up Firefox&lt;/a&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/12/6-simple-steps-to-speed-up-firefox.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-3346523013336214321</guid><pubDate>Sat, 15 Dec 2007 13:47:00 +0000</pubDate><atom:updated>2007-12-15T21:52:42.812+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Data Validation</category><title>Data Validation In Microsoft Excel</title><description>One good thing that Microsoft included in MS Excel is the capability to validate data entered in a cell without macro programming. This saves time. The programmer can concentrate on the business logic of the program and not data validation coding. Here&#39;s a video from YouTube that teaches how to do the validation:&lt;br /&gt;&lt;br /&gt;&lt;object width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/SzvDL9PZs1w&amp;rel=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/SzvDL9PZs1w&amp;rel=1&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/12/data-validation-in-microsoft-excel.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-6848716147444620327</guid><pubDate>Thu, 13 Dec 2007 12:58:00 +0000</pubDate><atom:updated>2007-12-13T20:59:50.086+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Project Management</category><title>Making a Gantt Chart with Excel</title><description>&lt;object width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/CW_wGSFavTc&amp;rel=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/CW_wGSFavTc&amp;rel=1&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;355&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/12/making-gantt-chart-with-excel.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-402106752223799676</guid><pubDate>Tue, 11 Dec 2007 12:34:00 +0000</pubDate><atom:updated>2007-12-11T20:36:37.241+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows</category><title>Make Windows XP Run Fast</title><description>Is your Excel and other application running slowly? I came across this very good tips on how to make Windows XP run fast. Watch the video below:&lt;br /&gt;&lt;br /&gt;&lt;object width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://sclipo.com/outer_flvplayer_new.swf?file=HWT3A8U3G8&quot;&gt;&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot;&gt;&lt;embed src=&quot;http://sclipo.com/outer_flvplayer_new.swf?file=HWT3A8U3G8&quot; type=&quot;application/x-shockwave-flash&quot; wmode=&quot;transparent&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/12/make-windows-xp-run-fast.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-3245537947756575198</guid><pubDate>Fri, 07 Sep 2007 06:24:00 +0000</pubDate><atom:updated>2007-09-10T19:49:00.829+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Blogger’s Notes</category><title>Data Source Is Out Of Control</title><description>Have you experienced to create an MS Excel reports wherein the source of data is a .CSV file that is extracted from an Oracle system? If yes, then maybe you have also experienced the situation that I have been through.&lt;br /&gt;&lt;br /&gt;A few months ago, I closed a contract to develop Purchase Order (PO) performance reports and Sales Order (SO) performance reports with one of my old clients. They looked very simple at first because there was no need for me to create data entry modules for the program. The source of the data would be coming from their Oracle system. Records would be entered from different countries across Asia Pacific and stored them into one central database server. Weekly, they would extract the records from it and convert it to Comma Separated file or .CSV file. My Macro program would import those contents of that .CSV file to my worksheets and somehow needed to consolidate them for reports and analysis purposes.&lt;br /&gt;&lt;br /&gt;At first, everything went smoothly. One day, the project liaison called and told me that there have been errors in almost all the reports. She sent me a copy of the macro file and source data file to check on the problems. As I was checking the reports of the Excel file one-by-one, reports were devastated. I investigated for hours all the macro modules but I hadn’t seen any clue of what happened to them. So, I asked myself; “How come a program in a good running condition suddenly gives incorrect figures in almost all reports?” The answer is actually right under my nose. When I checked the records in details, I saw the null values of all the Date Fields like “Actual Shipment Date”, etc. were changed. Originally, if the null date field was converted to .CSV file, the content was “NULL”. It was changed to dash (“-“) and eventually would give incorrect values in reports. To correct the problem, I spent days to modify the program modules and worksheet cell formulas that are related to all the date fields. Whew! It was tedious.&lt;br /&gt;&lt;br /&gt;That was a learning experience for me. I didn’t see that coming and hadn’t prepared for it. Partly, it was my fault because I presumed that the records format was final and didn’t realize that the data-entry program and data-conversion program were not mine and it could be changed anytime.&lt;br /&gt;&lt;br /&gt;For that particular reason, I requested the project liaison to collaborate with their Oracle programmer to advice us if records structures were altered.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/09/data-source-is-out-of-control.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-4534008388289775726</guid><pubDate>Fri, 07 Sep 2007 06:13:00 +0000</pubDate><atom:updated>2007-09-07T14:48:51.109+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Business / Financial</category><category domain="http://www.blogger.com/atom/ns#">Excel VBA Fundamentals</category><title>Number Rounding Off Issue</title><description>Three days ago, I was facing a difficult situation. A client of mine was asking me to make percentage-items of a report to sum up exactly to 100%. To visualize what I’m talking about, look at the example of figures below:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;# of items -------------&gt;%&lt;br /&gt;7 --------------------------&gt;58.33%&lt;br /&gt;1 --------------------------&gt;8.33%&lt;br /&gt;3 --------------------------&gt;25%&lt;br /&gt;1 --------------------------&gt;8.33%&lt;br /&gt;-----------------------------------------------------------&lt;br /&gt;12 --------------------------&gt;99.99% &lt;------TOTAL&lt;/span&gt;&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;The example above looks incorrect when you add all the percentage items as they are. The percentage total would be 99.99% and not 100%. It is even more incorrect if all percentage items are rounded off to the nearest one. See below:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-family:arial;color:#006600;&quot;&gt;&lt;strong&gt;# of items -------------&gt;%&lt;br /&gt;7 --------------------------&gt;58%&lt;br /&gt;1 --------------------------&gt;8%&lt;br /&gt;3 --------------------------&gt;25%&lt;br /&gt;1 --------------------------&gt;8%&lt;br /&gt;---------------------------------------------------&lt;br /&gt;12 --------------------------&gt;99% &lt;------TOTAL&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The total became 99%. But when you put the same calculation to Microsoft Excel, it would display a different result. Please create a New Worksheet in MS Excel and enter the following:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-family:arial;color:#006600;&quot;&gt;Cell A1 = 7&lt;br /&gt;Cell A2 = 1&lt;br /&gt;Cell A3 = 3&lt;br /&gt;Cell A4 =1&lt;br /&gt;Cell A5 =SUM(A1:A4)&lt;br /&gt;&lt;br /&gt;Cell B1 = A1/$A$5&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Copy formula of B1 to B3-B4 and copy A5 to B5. Format the entire column B to “Percentage” with zero decimal places. When done, you would see the following result:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;# of items -------------&gt;%&lt;br /&gt;7 --------------------------&gt;58%&lt;br /&gt;1 --------------------------&gt;8%&lt;br /&gt;3 --------------------------&gt;25%&lt;br /&gt;1 --------------------------&gt;8%&lt;br /&gt;----------------------------------------------------&lt;br /&gt;12 --------------------------&gt;100% &lt;------TOTAL&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The result as you have seen is very interesting. Microsoft treated the value of each individual percentage-item as the number of its formula result and not as what is displayed. This is why the total percentage is 100% and not 99%. In general practices, the MS Excel computation is acceptable to most people and they consider the difference negligible. But there are few people who disagree with this kind of result and consider it unlikely and incorrect to present this type of calculation. Truly, the situation is really a matter of personal point of view and consideration of the person going on this kind of situation.&lt;br /&gt;&lt;br /&gt;To satisfy those few people who prefer to have each percentage item to add up to exactly 100%, a VBA script is can be created to do the trick. However, before I present to you the solution, I would like to reiterate that the idea is a matter of preference and most likely debatable to most people because they prefer the Microsoft Excel way. It is correct to some people and the rest of them think otherwise.&lt;br /&gt;&lt;br /&gt;Run the script below:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Sub ComputePercentage() &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Dim i As Integer &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Dim x As Integer &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Dim Tot As Single &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;i = 1 &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color:#006600;&quot;&gt;&lt;span style=&quot;font-family:arial;font-size:85%;&quot;&gt;&#39;ROUTINE TO GET THE ROW LOCATION OF THE PERCENTAGE TOTAL &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;&quot;&gt;&#39;AFTER THE LOOP i HAS THE ROW NUMBER &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Do While Not Cells(i, 2).Formula Like &quot;=SUM*&quot;&lt;br /&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;i = i + 1 &lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Loop &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;&lt;span style=&quot;color:#006600;&quot;&gt;&#39;COMPUTE THE PERCENTAGES&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Tot = 0 &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;For x = 1 To i - 1&lt;br /&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;If x &lt;&gt; Cells(x, 2) = Round(Cells(x, 1) / Cells(i, 1), 4) &lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;&lt;blockquote&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Tot = Tot + Cells(x, 2)&lt;/span&gt;&lt;/blockquote&gt;Else&lt;br /&gt;&lt;blockquote&gt;Cells(x, 2) = 1 - Tot &lt;/blockquote&gt;End If &lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Next x&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;End Sub &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By the way, before you run the program, format the Column B to Percentage with 2 decimal places. When you run the program above, it would give you the following result.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;# of items -------------&gt;% &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;7 --------------------------&gt;58.33% &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;1 --------------------------&gt;8.33% &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;3 --------------------------&gt;25.00% &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;1 --------------------------&gt;8.34% &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;--------------------------------------------------------- &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#006600;&quot;&gt;&lt;strong&gt;12 --------------------------&gt;100% &lt;------TOTAL &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Notice that the last percent number is slightly incorrect. When you divide 1 with 12 the quotient is 8.333333… I will say it again, to those people who prefer it this way, they might consider the inaccuracy of the last number as so small as to be neglected.&lt;br /&gt;&lt;br /&gt;It is for you to decide (or your client) which one to use.&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/09/number-rounding-off-issue.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-6028395530213042351</guid><pubDate>Thu, 23 Aug 2007 10:41:00 +0000</pubDate><atom:updated>2007-08-29T16:20:26.730+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ActiveX Data Objects (ADO)</category><category domain="http://www.blogger.com/atom/ns#">Advanced Excel VBA</category><title>Creating Tables and Columns at Run Time</title><description>The following code is an example of creating a Table and Columns using ActiveX Data Objects (ADO):&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;Sub CreateEmployee() &lt;/span&gt;&lt;span style=&quot;font-family:arial;font-size:85%;color:#000099;&quot;&gt;&lt;blockquote&gt;Dim cn As ADODB.Connection&lt;br /&gt;Dim strSQL As String&lt;br /&gt;Set cn = New ADODB.Connection&lt;br /&gt;cn.ConnectionString = &quot;Provider=Microsoft.Jet.OLEDB.4.0; &quot; &amp; _&lt;br /&gt;&quot;Data Source=c:\test.mdb;&quot;&lt;br /&gt;cn.Open&lt;br /&gt;strSQL = &quot;CREATE TABLE `Employee` (`Last Name` varchar(30), `First Name` varchar(30), `Age` integer)&quot;&lt;br /&gt;cn.Execute strSQL&lt;br /&gt;cn.Close &lt;/blockquote&gt;End Sub&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/08/creating-tables-and-columns-at-run-time.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-4327993088253659317.post-8017623704011103911</guid><pubDate>Thu, 23 Aug 2007 10:33:00 +0000</pubDate><atom:updated>2007-08-29T16:21:58.547+08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">ActiveX Data Objects (ADO)</category><category domain="http://www.blogger.com/atom/ns#">Advanced Excel VBA</category><category domain="http://www.blogger.com/atom/ns#">Connection String</category><category domain="http://www.blogger.com/atom/ns#">Recordset</category><title>Three Main Objects of ADO</title><description>&lt;strong&gt;Connection Object&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This object is the one used to connect to database, which is then used to execute commands against the database or retrieve a Recordset. The object has the ConnectionString property that is used to specify the database you want to connect to. The Open method establishes the database connection. The Close method releases the connection and the memory used by the object.&lt;br /&gt;&lt;br /&gt;The Connection String can be generated at run time using the DataLinks. Please see the topic Building Database Connection String Programmatically.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Connection String Attributes:&lt;/strong&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;color:#000099;&quot;&gt;Provider&lt;/span&gt; – The provider name or driver name that ADO will use to access the database.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;color:#000099;&quot;&gt;User ID&lt;/span&gt; – When needed, it is used by the provider to establish the proper rights for accessing the database.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;color:#000099;&quot;&gt;Password&lt;/span&gt; – To validate the user, the user’s password is needed by the provider.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;color:#000099;&quot;&gt;Integrated Security&lt;/span&gt; – Setting this value to SSPI, the driver will use the Windows NT Integrated&lt;br /&gt;Security. User ID and Password are not used when this is done.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;color:#000099;&quot;&gt;Data Source&lt;/span&gt; – If you are connecting to an Access database, this should be set to the file and complete path of the file. This should have the machine name when connecting SQL Server.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:arial;color:#000099;&quot;&gt;Initial Catalog&lt;/span&gt; – This attribute should have the database name when connecting to SQL Server.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Recordset Object&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;This object is important because it is used to manipulate databases. It is a memory allocation in a client computer or server that has a set of rows of one table or more of the database. With Recordset, you can add, edit, delete and update records of the actual table in the database.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Command Object&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;This object has the information about the command to be executed. The command object could have a Query (SQL) command, Table, View or Stored Procedure.&lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;br/&gt;
&lt;br/&gt;
&lt;b&gt;
&lt;a href=&quot;http://msexcelvba.blogspot.com&quot;&gt;Visit the PRO-BUSINESS EXCEL VBA PROGRAMMING blog for more interesting tips.&lt;/a&gt;
&lt;/b&gt;
&lt;br/&gt;&lt;/div&gt;</description><link>http://msexcelvba.blogspot.com/2007/08/three-main-objects-of-ado.html</link><author>noreply@blogger.com (Unknown)</author><thr:total>1</thr:total></item></channel></rss>