You are on page 1of 4

Macros: Assigning a shortcut for a series of steps in Excel

To get started with creating macros, you’ll first want to add the Developer tab to your ribbon. To do that, go to
Excel Options and then Customize Ribbons. On the right panel, you will see a box that says Developer. Put a check
on the box next to it. Click OK after that.

Once you’ve added the Developer tab, follow these steps to create an Excel macro:

1. Navigate to the Developer tab and select the Record Macro button in the Code group OR click the button in
the bottom left corner of your screen that looks like a spreadsheet with a red dot in the top left corner.
2. Create a name for your macro. Spaces are not allowed, but you can use an underscore instead. In the
graphic on this page, I’ve named our macro “Format_Report.”
3. Select a shortcut key. Be sure to choose a letter not already being used as a shortcut key as it will replace
the original (i.e., don’t use Ctrl+Z unless you want to lose your shortcut for Undo). By using Shift, you can
expand your options (i.e., you could use Ctrl+Shift+Z instead). In the illustration, I’ve designated
Ctrl+Shift+R as the shortcut key.
4. Choose where to store your macro. Usually, you’ll want to store your macro in This Workbook, which is
what I’ve selected in the example. If you want it to be available whenever you use Excel, select Personal
Macro Workbook from the drop down menu.
5. Type a brief description about what your macro will do in the Description box.
6. Click OK.

The macro recording has begun, and now it’s time to perform the actions you want to record.

When you’re done, press Stop Recording button in the Code group on the Developer tab.
To save the excel file with the macro intact, while saving it, save it as

Few videos that will help you understand basic operations that can be done using Macros.

https://www.youtube.com/watch?v=kzLzGhq0NoI

https://www.youtube.com/watch?v=ABXa6X18nyo

https://www.youtube.com/watch?v=15wKNSqUuiE

https://www.youtube.com/watch?v=OlLCuclgf3A

The above videos are progressively more and more complex in nature hence you are advised to watch them in the
given sequence only.

YouTube give suggestions for further viewings on the same topic; hence do not stop after watching the above
videos only. Spend some more time in exploring how various Excel tools can be combined with Macros to give
desired results. Please note that Macros use VBA language and complex macros can be made if you know VBA.
Since I have not included the same in our course, you can steer clear of the examples that use VBA.

Task 1

Create a form where a sales person can key in details about a customer and after clicking on a “Submit” button, it
automatically does the following

a) Tells the customer the loan eligibility in terms of LTV (loan to value ratio)
b) Automatically updates the salesperson’s database with all relevant customer data

You can attach the eligibility criteria to customer’s stated income with the following criteria

Loan declined if monthly income is less than Rs. 25000, 50% if it is less than Rs. 70000, 80% if it is above 80%
Task 2

In the file named Raw Data Practice (that was discussed in last class), design a system wherein if one enters the
Order ID, then all the relevant details are returned at the click of a button. In addition, create a separate button
called “Reset” which when pressed, deletes all the data so that one can enter a new Order ID.
Goal Seek

If you know the result that you want from a formula, but are not sure what input value the formula needs to get
that result, use the Goal Seek feature.

To use this tool, follow the below steps

a) On the Data tab, in the Data Tools group, click What-If Analysis, and then click Goal Seek.
b) In the Set cell box, enter the reference for the cell that contains the formula that you want to resolve.
c) In the To value box, type the formula result that you want.
d) In the By changing cell box, enter the reference for the cell that contains the value that you want to
adjust.

Please go through the following videos in YouTube

https://www.youtube.com/watch?v=7QIBvMPC9vM

https://www.youtube.com/watch?v=fcKCUDyF73Y

https://www.youtube.com/watch?v=OhnkuBVTcg8

This is a pretty easy concept and hence I am not giving any tasks.

Solver

Solver is a Microsoft Excel add-in program you can use for what-if analysis. Use Solver to find an optimal
(maximum or minimum) value for a formula in one cell — called the objective cell — subject to constraints, or
limits, on the values of other formula cells on a worksheet. Solver works with a group of cells, called decision
variables or simply variable cells that are used in computing the formulas in the objective and constraint cells.
Solver adjusts the values in the decision variable cells to satisfy the limits on constraint cells and produce the result
you want for the objective cell.

Put simply, you can use Solver to determine the maximum or minimum value of one cell by changing other cells.

For practice, please refer to the excel file that has been forwarded to you separately named Solver Practice.

You might also like