EXCEL VBA MACROS EXERCISES▼
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.
You can learn how to do this exercise if you attend one of more of the courses listed below!
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:
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.