|
|||
| What is a macro in Microsoft Excel? An Excel
macro is a set of instructions that Microsoft Excel executes to perform
an action, for example, a calculation. This set of instuctions or macro
is written in a computer programming language called Visual Basic for
Applications or VBA. VBA or macro coding is easy to learn. The VBA
editor is provided with Microsoft Excel. Macros help us to automate many repetitive
tasks. We have written and executed two macros in the Excel training video. The first Excel macro shows a 'welcome' message. The second Excel macro calculates the total price of an item by adding 'VAT'. When you run the first macro the cursor must be in its region and for running the second calculation macro you must place the cursor in its region. Later on we'll learn how to run multiple macros automatically. The second 'do while' macro has a starting point: it checks wherther there is data in row 2 and column 1. If true it calculates the total by adding the values of the two defined cells. Then it goes to the next row and again checks whether the cell in row 3 and column 1 has data. If it is true it continues its calculations. It keeps on 'looping' till it reaches the row x and column 1 which have no data. Here it stops. The program 'knows' its job is finished. Even if you find the 'syntax' or 'grammar' of the macros confusing now, don't worry. It's easy to learn and master with some practice. How does one write a macro practically?
|
|||
|
|||
|
|
|||
|
|
|||
|
|
|||