Sunday, 10 February 2013

Excel VBA Macro: How to use InputBox

Following example video demonstrates how to use Input Box dialog from the Excel VBA Macro code.  In this example input type is Range-object. Example code asks user to select cells and then fills those cells with text "Foo".

Tip: If you have difficulties to see the video, try to maximise it from lower right corner.





How to customise Excel table's look and feel

There are numerous ways you can customise how your Excel table looks. Yo can e.g.
  • Change the font color or cell's fill colour
  • Make texts bold, italic, etc.
  • Draw different kinds of borders around your cells
  • Align cell's texts different ways
  • Merge cells to make it easier to align texts the way you like
  • Adjust column widths and cell heights
  • Hide Excel's gridlines
  • ...and much more...
A shortcut tip: You can open Format Cells -dialog by pressing

  • Windows: ctrl + 1
  • Mac: cmd + 1

Following demonstration video shows some of these techniques to format a table (Tip: If you have difficulties to see the video, try to maximise it from lower right corner):



Saturday, 9 February 2013

How to use Excel's VLOOKUP-function

VLOOKUP-function is a great help when you need to find data from the large tables. With VLOOKUP you can search for a value in the first column of the table and return a value in the same row from the column you specify. VLOOKUP has three mandatory parameters and one optional parameter:
  1. parameter: Value to search in the first column
  2. parameter: Table to search from
  3. parameter: Index of the column from which the matching value must be returned. The index of the first column is 1
  4. optional parameter: If omitted or TRUE, an exact or approximate match is returned. If an exact match is not found, the next largest value that is less than lookup_value is returned. If FALSE, VLOOKUP will only find an exact match.
The following video demonstrates a simple example how to use VLOOKUP:



Friday, 8 February 2013

Excel VBA macros: How to add button to worksheet

In my previous blog post I launched Excel VBA macro from Ribbon bar's Developer tab (Macros). More user friendly way is to add push button for macro directly to worksheet. Following video demonstrates how to do it (Tip: If you have difficulties to see the video, try to maximise it from lower right corner):



Thursday, 7 February 2013

Excel VBA macros: How to record a VBA macro

It is a good idea to automatise time consuming routine tasks in Excel. You don't need to know how to implement VBA macros, because you can just record your tasks. In following example I record a macro that assumes that I have people's whole names listed in column A and want to split names (first name and last name) into columns A anB. This is good example when simple recorded macro can save you from doing this routine task all over again.

Here is a video that demonstrates the VBA macro recording and shows how to run the macro (Tip: If you have difficulties to see the video, try to maximise it from lower right corner):


Wednesday, 6 February 2013

How to import text and use Excel's Text to Columns -feature

Normally, when you paste text to Excel, the whole text will appear in one column. Luckily Excel has nice feature called Text to Columns. With that feature you can spread your text data to columns nice and easy. In my example, I have text where items are delimited with commas and colons.

Following video demonstrates how to import that text to Excel's columns easily (Tip: If you have difficulties to see the video, try to maximise it from lower right corner):



Tuesday, 5 February 2013

How to use Excel's Goal Seek analysis

Excel provides many ways to analyse data. One powerful tool is Goal Seek -tool. Following demo presents a simple example to find out body weight when target Body Mass Index (BMI) is known by using Goal Seek analysis. All we need to do is to know the formula of BMI and then define target BMI. We try to solve out the body weight that is needed to achieve our target BMI.

The formula for BMI is:

BMI = Weight[kg] / (Height[m] x Height[m])

The following video demonstrates this: