<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19636081</id><updated>2012-02-17T05:43:41.652+08:00</updated><category term='Macro'/><category term='VBA'/><category term='MS Access'/><category term='Excel Function'/><category term='MS Excel'/><title type='text'>FMk decode...</title><subtitle type='html'>From the user point of view</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fmkdecode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19636081/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://fmkdecode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Faiz MK</name><uri>http://www.blogger.com/profile/11647521778073378653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19636081.post-2932119090439019361</id><published>2009-11-28T16:43:00.006+08:00</published><updated>2009-11-28T17:25:33.955+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VBA'/><category scheme='http://www.blogger.com/atom/ns#' term='MS Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='Excel Function'/><title type='text'>Auto Naming Excel Sheets and Function Across Sheets</title><content type='html'>&lt;span style="font-size:100%;"&gt;Here's the scenario I faced. I was given an Excel file which&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;consists of 120 sheets of data in uniform template, that&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;any of them belong to only one of 3 main categories, and&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;under each category, any of them belongs to only one of 3 regions, and&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;I have to summarise them in a single "Summary" sheet.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;Here what I've done. Because the Excel sheets are named somewhat arbitrary, I firstly need to rename them to a more consistent grouping.&lt;br /&gt;&lt;/span&gt;&lt;ol style="font-family: courier new;font-family:courier new;" &gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Public Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Source As Range)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    Dim nameln As Integer&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    Dim shname As String&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    .&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    nameln = Application.WorksheetFunction.Find(" ", Range("A1"), 13)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    shname = Left(Range("A1"), nameln - 1)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    ActiveSheet.Name = shname &amp;amp; " " &amp;amp; shname2&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    ActiveSheet.Next.Select&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    Application.Wait (Now + TimeValue("0:00:01"))&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;    Range("I1").Value = ""&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;End Sub&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:100%;"&gt;After that, it is easier for me to use the SUM function across multiple sheets.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;=sum('Sales Oil Reg1 Cntrct1:Sales Oil Reg3 Cntrct120'!F20)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Cell F20 in each sheet represents the total sales for each Contract, so in the above formula, it summarises all the sales from all contract from all region.&lt;br /&gt;&lt;br /&gt;Here is another useful trick- because I made the auto naming to include its main category and region, I can do the function for only the sheets under each category (or region) by the following&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;=sum('Sales Oil*'!F20)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By the way, once you press Enter after typing in the formula, what Excel did was it analyse the shorthand formula and rewrite them if you were to do manually like &lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:courier new;"&gt;=sum('Sales Oil Reg1 Cntrct1'!F20, 'Sales Oil Reg1 Cntrct2'!F20)&lt;/span&gt; and so on.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19636081-2932119090439019361?l=fmkdecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fmkdecode.blogspot.com/feeds/2932119090439019361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fmkdecode.blogspot.com/2009/11/auto-naming-excel-sheets-and-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19636081/posts/default/2932119090439019361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19636081/posts/default/2932119090439019361'/><link rel='alternate' type='text/html' href='http://fmkdecode.blogspot.com/2009/11/auto-naming-excel-sheets-and-function.html' title='Auto Naming Excel Sheets and Function Across Sheets'/><author><name>Faiz MK</name><uri>http://www.blogger.com/profile/11647521778073378653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19636081.post-1482601769843051040</id><published>2009-09-19T09:04:00.003+08:00</published><updated>2009-11-29T18:07:55.682+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS Access'/><category scheme='http://www.blogger.com/atom/ns#' term='Macro'/><title type='text'>Access Form: Cancel Changes Button</title><content type='html'>When you enter values in Access forms, and later decided to discard them, there is no ready button that can do such thing. The Cancel button as provided by Access form wizard just simply closes the form. As anybody familiar with Access, once you typed something in forms that are bound to tables, those values are automatically registered as new record.&lt;br /&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;Below is my workaround in creating a Cancel button that actually undo any changes and close the form. This is Access 2007 embedded macro set for the Cancel button.&lt;br /&gt;&lt;table border="1" cellpadding="5" cellspacing="0" style="width: 494px;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign="top" width="130"&gt;&lt;strong&gt;Condition&lt;/strong&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="130"&gt;&lt;strong&gt;Action&lt;/strong&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="130"&gt;&lt;strong&gt;Arguments&lt;/strong&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="102"&gt;&lt;strong&gt;Comment&lt;/strong&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" width="130"&gt;&lt;/td&gt;&lt;td valign="top" width="132"&gt;On Error&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="131"&gt;Next,&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="104"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" width="129"&gt;[Form].[Dirty]&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="132"&gt;RunCommand&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="132"&gt;Undo&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="104"&gt;Perform Undo only when form content is modified, else, skip&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" width="130"&gt;[MacroError]&amp;lt;&amp;gt;0&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="132"&gt;MsgBox&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="132"&gt;=[MacroError].[Description], Yes, None,&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="104"&gt;Spit out the error message from system&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td valign="top" width="130"&gt;&lt;/td&gt;&lt;td valign="top" width="132"&gt;Close&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="132"&gt;, , Prompt&lt;br /&gt;&lt;/td&gt;&lt;td valign="top" width="104"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19636081-1482601769843051040?l=fmkdecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fmkdecode.blogspot.com/feeds/1482601769843051040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fmkdecode.blogspot.com/2009/09/access-form-cancel-changes-button.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19636081/posts/default/1482601769843051040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19636081/posts/default/1482601769843051040'/><link rel='alternate' type='text/html' href='http://fmkdecode.blogspot.com/2009/09/access-form-cancel-changes-button.html' title='Access Form: Cancel Changes Button'/><author><name>Faiz MK</name><uri>http://www.blogger.com/profile/11647521778073378653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19636081.post-113390239738010625</id><published>2005-12-07T04:53:00.000+08:00</published><updated>2005-12-07T04:53:17.390+08:00</updated><title type='text'>Small Concept</title><content type='html'>Designing an ALU model is a straightforward problem. Still, making the model works, requires a colossal amount of understanding in logic synthesis – that is how a block of several gates can be arranged to achieve a certain operation such as addition or subtraction.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19636081-113390239738010625?l=fmkdecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fmkdecode.blogspot.com/feeds/113390239738010625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fmkdecode.blogspot.com/2005/12/small-concept.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19636081/posts/default/113390239738010625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19636081/posts/default/113390239738010625'/><link rel='alternate' type='text/html' href='http://fmkdecode.blogspot.com/2005/12/small-concept.html' title='Small Concept'/><author><name>Faiz MK</name><uri>http://www.blogger.com/profile/11647521778073378653</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
