
This is one not to miss – because if for whatever reason the macro operates when you’re on a different sheet in Excel, the macro will copy and paste whatever is in the range on the active sheet. Use a named range on the ranges to achieve this.

We can also name the ranges of the J10:M10 to make the macro more robust. The “For i = 1 to 10” gives the instructions to run this (i is an undefined variable which VB keeps track of), and the “Next” gives the instructions to finish that cycle and go back to the “For.” You can think of the “For” and “Next” as bookends! A For Loop will run the code for a specified number of times – in the example below, ten times. This makes the macro run faster – and is clearer to the user. Range(“J11:M11”).PasteSpecial Paste:=x1PasteValues ‘ This macro copies the interest calculated row into the interest applied row When you’re done, select ‘Stop Recording’ from the Developer ribbon. Follow these four steps as you would ordinarily in Excel: A fairly reliable one is: View > Macros > Record Macro:Īfter naming the macro and clicking “OK,” you are given the opportunity to record a macro.


To access the record macro there are a few different ways. Recording a macro is the first port of call to understand how actions translate from Excel into VBA. Feel free to try this as we go, it doesn’t necessarily need to be on a project finance model – but any copy paste will cement these skills. You should end up with a robust and quick macro, via a ten minute macro tour of duty. The following is our five-step foray into how to speak to macros nicely. The debt sizing macro is one of the exceptions because it can take calculations that take 40 minutes, and reduce them to 30 seconds through just a tiny bit of simple streamlining. That’s because while they can be extremely powerful, they undercut one of Excel’s key advantages, which is transparency and flexibility. What are Excel Macros?Įxcel Macros refer to a sequence of steps written in Excel VBA that can be used to automate tasks within Excel.Īs a general best practice in financial modeling, macros should be used sparingly. a goal seek macro to calculate sales price, or development fee based off a target IRR), the copy-paste is definitely the workhorse. While macros are also used elsewhere in project finance models (e.g. The debt sizing macro is simply a copy / paste macro, which calculates debt sizing through either a gearing ratio, or DSCR target. In this article, you’ll learn how to build a debt sizing macro commonly used in project finance models. Where to next? One macro to rule them all.Step 5: Speed up and refine with the Direct Copy.

5 steps to building a debt sizing macro.
