How To Write Macros in Excel
How To Write Macros in Excel
How To Write Macros in Excel
Step Tutorial
As humans, we are creatures of habit. There are certain things
that we do on a daily basis every working day. Wouldn't it be
better if there were some magical way of pressing a single
button and all of our routine tasks are done? I can hear you
say yes. In a nutshell, a macro is the magical single click
button.
We will cover the following topics in this tutorial.
What is a macro?
The importance of macros in Excel
What is VBA in a layman's language?
Macro Basics
Step by step example of recording macros in Excel
What is a macro?
A macro is a piece of programming code that runs in Excel
environment and helps automate routine tasks. In a layman's
language, a macro is a recording of your routine steps in
Excel that you can replay using a single button.
You can import the data into Excel and format. The following
day you will be required to perform the same ritual. It will soon
become boring and tedious. Macros solve such problems by
automating such routine tasks. You can use a macro to
record the steps of
Macro Basics
Macros are one of the developer features. By default, the
tab for developers is not displayed in excel. You will need
to display it via customize report
If you want to save macros, then you must save your workbook
in a macro-enabled format *.xlsm
The macro name should not contain any spaces.
Step 4) You will now be able to see the DEVELOPER tab in the
ribbon
Go to the local drive where you have stored the CSV file
Select the CSV file
Click on Import button
Make the columns bold, add the grand total and use the SUM
function to get the total amount.
Now that we have finished our routine work, we can click on
stop recording macro button as shown in the image below
1. Select ImportBankReceipts
2. Highlights the description of your macro
3. Click on Run button
Summary
Macros simplify our work lives by automating most of the
routine works that we do. Macros in Excel are powered by
Visual Basic for Applications.