Excel Investment Banking VBA Slides
Excel Investment Banking VBA Slides
Excel Investment Banking VBA Slides
• Other languages, such as R and Python, are not useful for the
roles we focus on (IB, PE, CD, ER) – they’re more for trading,
portfolio management, or jobs with heavier statistical analysis
• The difference is that you can do more with these constructs, such
as “looping” through a specific range, or “saving” data for use in
some other function or directly on the spreadsheet
• Why: It requires you to change the borders, fill color, and font
color, and there’s no way to do all of that at once in a single key
stroke (and it’s even more annoying in Mac Excel)
• And: We can’t just use Copy and Paste Special → Formats because
we do not want to copy the Number Formats!
Your First VBA Macro
• How: We can create a macro for this by recording completion of
these actions in Excel, and then tweaking the code a bit
• Issue #1: Way too much code → don’t need separate “With”
statements for the borders, interior, etc. (group them together)
• Issue #2: It’s not very readable because there are too many
useless commands, and it’s hard to tell what the colors are
• Then: Set the font colors for these Formulas or Constants first, and
then do the border/fill/font/alignment formatting if cells exist
Recap and Summary
• Is VBA Useful? Yes, but you don’t need to be an expert