From the course: Excel: Learning VBA
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Add code to a recorded macro - Microsoft Excel Tutorial
From the course: Excel: Learning VBA
Add code to a recorded macro
- [Instructor] Writing VBA code can take a lot of time, but there is a shortcut. Many times, you can record a macro that does what you want and then change it by editing the macro in the Visual Basic editor. In this movie, I will show you one scenario where that would be very useful. My sample file is 01_10_RecordFirst, and you can find it in the Ch01 folder of the Exercise Files collection. In this workbook, on the PivotSummary worksheet, I have a pivot table, and you can see that I have the Year in the Columns area and Sum of Total in the Values area, but nothing in the Rows area. So what I'll start by doing is adding Month to the Rows area and record a macro of me doing that, and then edit it, so that instead of Month, it will do Infusion. And Infusion just means a flavor that is added, in this case, to olive oil. So I'll start by ensuring that a cell within the pivot table is selected, in this case B5. And…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
(Locked)
Introduce object-oriented programming3m 2s
-
(Locked)
Examine the Excel object model4m 14s
-
(Locked)
Work in the Visual Basic Editor6m 27s
-
(Locked)
Set VBA project properties4m 28s
-
(Locked)
Create, export, and delete code modules5m 54s
-
(Locked)
Create a subroutine3m 28s
-
Create a function5m 2s
-
(Locked)
Add comments to your code4m 47s
-
Run a VBA procedure5m 20s
-
(Locked)
Add code to a recorded macro3m 48s
-
(Locked)
-
-
-
-
-
-
-