How do I write a macro in excel for the CAPM formula??
Step 1: Go to File --> Options --> Customise Ribbon --> select 'Developer', to enable macros.
Step 2: Go to Developer tab --> press 'Record Macro'. It will show a dialog box and ask you to enter a name for the macro and where to store it. Suppose you give it the name 'CAPM' and store it in the current workbook. You can give a description if you want. Click OK.
Step 3: In the cell, where CAPM is to be calculated, enter the formula by linking it to the respective cells for risk-free rate, beta and market return. Press 'Enter'. Stop recording macro.
Step 4: For running the macro, press Alt key + Fn key + F8. It will open up a Macro dialog box. Click on your macro name to run it.
Get Answers For Free
Most questions answered within 1 hours.