Escolar Documentos
Profissional Documentos
Cultura Documentos
ES2513
The Macro Record Feature & VBE
Purpose of the assignment is to learn how to use the VBA macro record.
I. The Macro Record Feature, refer to chapter 2 in the course text (T. Urtis).
1. Make sure your system is set up to show the file extensions.
a. Click start button (lower left corner)
b. Select the Control Panel
c. Select the Appearance and Personalization
d. Click Folder Options
e. Select the View tab and from Advanced Settings,
f. Look for the Hide extensions for known file types selection box. De-select
the box.
2. Add the VBA Developer to the ribbon interface:
a. Select the File tab within the ribbon.
b. Select Options from the File dropdown menu
c. Select Customize Ribbon on the left.
d. From the selection pane labeled Customize Ribbon, look for the selection
box labeled Developer. Make sure the Developer box is selected.
e. Select OK to complete.
3. Give your workbook and worksheet descriptive names. Save it as a Macro enabled
workbook: *.xlsm. If you dont save it now, you will have regrets later.
4. You will create your first macro using the record button. This is similar to lesson
two in the textbook (and accompanying DVD), by T. Urtis.
5. You will work on two worksheets for this lab. After completing each macro, go to the
second worksheet and run it to confirm it works correctly.
3. Select cell C6. Create a table on a worksheet that contains a header with fields for
Finish Place, Racer Number, Racer Name, and Lap Number.
Finish Place
Racer Name
Racer Number
Lap Number
4. Below the Lap Number, enter a column of values from 1 to 25. This represents the
25 laps for the race.
5. Go ahead and resize the cells and center the text.
6. Select the A1 cell and select the Stop Recording icon. This will end the recording.
7. Go to the 2nd worksheet and test the macro.
8. Return to the first worksheet, and start the next macro.
Next Macro (RaceTable2)
1. Select the A1 cell. Start the Macro Recorder again. Name your macro RaceTable2.
2. Next to the lap-number, fill in the Lap Time and Cumulative Time. Copy these two
cells horizontally for six drivers. The example below shows the pattern for the first
two drivers. Resize the cells and center as desired.
Finish Place
Racer Name
Racer Number
Lab Number
Lap Times
Cumulative
Time
Lap Times
Cumulative
Time
3. Merge two horizontal cells just to the right of the Finish Place cell, copy that merged
pair to all the cells above the Lap Times and Cumulative times for all six racers. The
table should look similar to this example, but for all six racers.
Finish Place
Racer Name
Racer Number
Lab Number
Lap Times
Cumulative
Times
Lap Times
Cumulative
Times
4. Select the A1 cell and select the Stop Recording icon. This will end the recording.
5. Go to the second worksheet and test the macro.
6. Return to the first worksheet, and continue
Test Run
1. Create or move to a third worksheet and run ALL your macros to generate the table.
2. Enter names for the racers. The names should be your full name, the lab
instructors name, Kwame Rhodes, Helen Wheels, Stormy Driver, and Wanda
Steers. You must use these names only. Enter them in any finish order you desire.
3. Name this worksheet TestRun
5.
6.
7.
8.