Posted on 20 December 2009
The VBA Select Case Statement is an important construct in the VBA language. The Select Case statement in VBA allows the program to execute one set of statements out of many based on what a given expressions evaluates to. In today's post we will look at some basic and intermediate ways in which it can be used when writing VBA code.
Basic Form of the VBA Select Case Statement
[cc lang="vb"]
Select Case expression_to_test
Case expression_value_1 : Code to Execute When expression_to_test = expression_value_1
Case ...
Continue Reading
Posted on 16 December 2009
In
Six Sigma Control charts using Excel we saw how to make
control charts using named ranges. From there on, it was a short hop to porting the logic to VBA. So here is the VBA code for automating the creation of a six sigma control charts. It has been tested with Excel 2000, Excel 2007 and Excel 2010.
How to Use the Control Chart Program
1. Simply click the 'Make Control ...
Continue Reading
Posted on 13 December 2009
One axis charts combined with the histogram are a great way to summarize unidimensional data. Excel does not provide provide in-built support for one axis frequency distribution charts but they can be created without breaking into a sweat.
The Histogram
The histogram trades off detail for ease of comprehension. Let's look at the chart below.
This one's based on a set of 250 data points with ...
Continue Reading
Posted on 11 December 2009
When raw data (in text *txt or csv format) is imported to excel, the conversion can sometimes have an unintended side-effect - the numbers come out as text after the process. The only choice left is to identify the columns that contain numbers masquerading as text and then to use the
text to column option on each of the columns one-by-one. If the number of columns is large, eyeballing the data can be a bit of a strain.
Here a ...
Continue Reading
Posted on 10 December 2009
Always wanted to make a stacked bar graph but were afraid connoisseurs would smirk. Let me present - the stacked bar graph with helper bars - the latest addition to the charting fraternity. (Drum rolls)
In case you were wondering how this one got made, here are the steps:
Set Up the Data for the Bar Graph
In this example, we pick up ...
Continue Reading
Posted on 10 December 2009
Looks like I am not the only one suffering from browse fatigue. Excel guru
Dick Kusleika recently made the shift from Firefox to Chrome and he wasn't very impressed. I myself have been fiddling around with various browsers lately. Right before
my earlier computer gave up the ghost and I shifted on to the new one, I had been hell bent on squeezing out the last remaining ounce of ...
Continue Reading
Posted on 09 December 2009
Pareto charts are one of the basic pillars of the six sigma methodology and are typically used to depict the frequency of occurrence of issues that affect 'production'. Although one usually sees them being used as standalones, the humble pareto chart can very well be augmented in order to make it a much more meaningful tool for tracking and resolving pending issues & errors. Let's look at one such approach that utilizes a combination of a horizontal pareto chart ...
Continue Reading
Posted on 03 December 2009
Here are some quick keyboard shortcuts in Excel to help you survive in the
pivot table jungle.
Keyboard shortcut to Sort Fields and Items in a Pivot Table
Thought that you would have to drag the field or the item across the pivot table using the mouse. Hold on - you can use the keyboard too.
Simply type the field or the item ...
Continue Reading
Posted on 01 December 2009
A timeline chart allows the reader to understand the chain of events as they take place over a period of time. The events are typically represented as markers along a horizontal or a vertical line.
In our previous post on adding
interactive labels to chart, we saw how to fit a large number of event descriptions in a single chart. Today we look at a similar approach in order to ...
Continue Reading
Posted on 27 November 2009
The remove background tool is one of the new features introduced in Office 2010. Ever since I downloaded the public beta, I've been itching to take it for a test drive and this weekend, I did just that. I tried my hands at two images - one with high and the other with low contrast. So let's look at the results
Remove Background from a High Contrast Image
We picked up an ...
Continue Reading
Posted on 24 November 2009
My first impression of
Excel 2010 was that it 'felt' faster than Excel 2007. So one of the first things that I did was to take it for a test ride. Now, I must admit, testing isn't my forte. A long long time back when I was a developer, I used to write horrible code. I had a fancy for declaring variables like i1, i11, i111 (and so on and so forth) and seldom wrote comments that could explain ...
Continue Reading
Posted on 23 November 2009
Here is some VBA code that can help you automate working with a
slicer in Excel. Slicers, as you would know, are the latest introduction to Excel. As I mentioned in my previous post, they can also be programattically controlled using simple VBA code. Let's see how.
Slicer Creation using VBA - Basic Steps
Let's look at the slicer hierarchy - a workbook has slicer caches (accessed the SlicerCaches object), each slicer cache in turn having multiple slicers (one for each ...
Continue Reading
Posted on 20 November 2009
Slicer
What is a Slicer? One can think of a slicer as an extension of a
pivot table which makes the job of filtering the pivot table data easier. One shortcoming that pivot tables earlier had was that you could not control them remotely. Short of VBA, you could do things with pivot tables only when you had one in front of you. A slicer on the other hand acts as a 'remote control' for the pivot table. You can ...
Continue Reading
Posted on 19 November 2009
Excel 2010 introduces a new feature called sparklines. Sparklines are essentially miniature charts showing only the plot and pretty much nothing else (though you can turn on chart axis if you want). The advantages are obvious. In the same amount of space that it to present a normal excel chart with a handful of data points, you can pack a dozen or more sparkline charts. If used intelligently, the data loss due to absence of reference lines and ...
Continue Reading