Excel VBA Macros | Recording macros and buttons exercise | Big Cheese - Recording Absolute Macros

This exercise is provided to allow potential course delegates to choose the correct Wise Owl Microsoft training course, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Software ==> Excel VBA Macros  (52 exercises)
Version ==> Any version of Excel
Topic ==> Recording macros and buttons  (6 exercises)
Level ==> Average difficulty
Subject ==> VBA training
Before you can do this exercise, you'll need to download and unzip this file (if you have any problems doing this, click here for help).

You need a minimum screen resolution of about 700 pixels width to see our exercises. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

Open the file shown in the folder above.

Before you start recording a macro, take a copy of the current sheet so you have a replica to test your macro on later.

Record a macro called FormatTable, with the shortcut CTRL + SHIFT + F, which will format the table and add a formula into column C to calculate the ratio of people who prefer each cheese.

The final table should look like the below:

Excel VBA Macros exercise - Recording macros and buttons (image 1)

You could also add borders if you wish.

The steps involved in this macro are:

  • In Cell C3 add in the header % People.
  • Highlight Columns A-C and centre the text within each column.
  • Align the main header Favourite Cheeses Data across Columns A-C.
  • Change the Font of the main header to Bold and Size 14pt.
  • Change the Font of the table headers in Row 3 to Bold and Size 12pt.
  • In Cell C5 type in a formula to calculate the ratio of the people who prefer that cheese.
  • AutoFill this down to the bottom of the list.
  • AutoSize the column widths.

Your ratio formula can use the SUM function to find to total number of people surveyed, there is a range name (PeopleNumbers) to help here.

Test your macro works whilst on the copy of the cheese sheet you made earlier.

Save the amended file as Le Grand Fromage - Formatted and close it down.

You can unzip this file to see the answers to this exercise, although please remember this is for your personal use only.
This page has 0 threads Add post