What Gets Recorded?
When you turn on the macro recorder, Excel converts your mouse and
keyboard actions into valid VBA code. I could probably write several pages
describing how Excel does this, but the best way to understand the process
is by watching the macro recorder in action. (Figure 6-1 shows how my
screen looked while I had the macro recorder turned on.)
Follow these steps:
1. Start with a blank workbook.
2. Make sure that the Excel window is not maximized.
3. Press Alt+F11 to activate the VBE (and make sure thatthisprogram
window is not maximized).
4. Resize and arrange the Excel window and the VBE window so that
both are visible.
For best results, position the Excel window on top of the VBE window,
and minimize any other applications that are running.
5. Activate Excel and choose Developer➪Code➪Record Macro.
6. Click OK to start the macro recorder.
Excel inserts a new module (named Module1) and starts recording in
that module.
7. Activate the VBE program window.
8. In the Project Explorer window, double-click Module1 to display that
module in the Code window.
Now play around for a while: Choose various Excel commands and watch
the code being generated in the VBE window. Select cells, enter data, format
cells, use the menus and toolbars, create a chart, manipulate graphics
objects, and so on — go crazy! I guarantee that you’ll be enlightened as
you watch Excel spit out the VBA code before your very eyes.
Hello. I am a beginner trying to learn how to code in vba. I'm taking baby steps at the moment.
I'm trying to figure out how I can use the macro recorder while viewing the changes in the vbe editor at the same time.
I'm trying to follow the instructions listed here but I'm having difficulty. After opening vbe editor I try to toggle back to the spreadsheet to input my data...but then the vbe editor just disappears.
Is there some sort of option that I am not toggling?
When you turn on the macro recorder, Excel converts your mouse and
keyboard actions into valid VBA code. I could probably write several pages
describing how Excel does this, but the best way to understand the process
is by watching the macro recorder in action. (Figure 6-1 shows how my
screen looked while I had the macro recorder turned on.)
Follow these steps:
1. Start with a blank workbook.
2. Make sure that the Excel window is not maximized.
3. Press Alt+F11 to activate the VBE (and make sure thatthisprogram
window is not maximized).
4. Resize and arrange the Excel window and the VBE window so that
both are visible.
For best results, position the Excel window on top of the VBE window,
and minimize any other applications that are running.
5. Activate Excel and choose Developer➪Code➪Record Macro.
6. Click OK to start the macro recorder.
Excel inserts a new module (named Module1) and starts recording in
that module.
7. Activate the VBE program window.
8. In the Project Explorer window, double-click Module1 to display that
module in the Code window.
Now play around for a while: Choose various Excel commands and watch
the code being generated in the VBE window. Select cells, enter data, format
cells, use the menus and toolbars, create a chart, manipulate graphics
objects, and so on — go crazy! I guarantee that you’ll be enlightened as
you watch Excel spit out the VBA code before your very eyes.
Hello. I am a beginner trying to learn how to code in vba. I'm taking baby steps at the moment.
I'm trying to figure out how I can use the macro recorder while viewing the changes in the vbe editor at the same time.
I'm trying to follow the instructions listed here but I'm having difficulty. After opening vbe editor I try to toggle back to the spreadsheet to input my data...but then the vbe editor just disappears.
Is there some sort of option that I am not toggling?