|In the Visual Basic Editor program
Microsoft Excel, you can view the recorded macros code created
automatically. You can also edit the macro code to perform another
action. For example, instead of multiplying two numbers you could
change the Excel macro code by replacing the '*' with a '/' and perform
a division through the macro! The Excel training video depicts how
easily you can check the macro code in the Visual Basic Editor.
- Click on Tools
- Select Macro, Macros...
- Slect the recorded Macro
- select 'Edit'
- Now you can view the code of the recorded Excel macro
the VBA editor
- The name of the macro is Macro1
- The code lines with an apostrophe and green colored
known as remarks
- The ActiveCell is the cell where your cursor is and
you wrote '=B2*C2' which is indicated in the macro by 'FormulaR1C1'. R
stands for row and C for column
- RC[-2] stand for B2 and represents a cell in the same
as the formula cell but 2 columns to the left. RC[-1] denotes a cell
address in the same row but one column to the left. RC[-2]*RC[-1] =
- Range("D3").Select means your cursor is now in cell
which happens after you press enter after writing the formula in cell