ROI Calculator with Scenarios
Calculate Return on Investment with multiple scenario analysis
482 views
Featured
Perfect For:
- Investment analysis
- Business cases
- Financial planning
PRO Template
Sign up for free to unlock the complete VBA code and access all templates
VBA Code (Preview)
Sign up to copy
Sub ROICalculator()
Dim ws As Worksheet
Dim initialInvestment As Double
Dim annualCashFlow As Double
Dim years As Integer
Dim discountRate As Double
Dim scenarios As Variant
Dim i As Long
' Create new worksheet
Set ws = Worksheets.Add
ws.Name = "ROI_Analysis_" & Format(Date, "mmyyyy")
' Get input parameters
initialInvestment = CDbl(InputBox("Enter initial investment amount:"))
annualCashFlow = CDbl(InputBox("Enter expected annual cash flow:"))
years = CInt(InputBox("Enter investment period (years):"))
discountRate = CDbl(InputBox("Enter discount rate (e.g., 0.10 for 10%):"))
' Set up headers
ws.Range("A1").Value = "ROI Analysis Report"
ws.Range("A1").Font.Size = 16
ws.Range("A1").Font.Bold = True
ws.Range("A3").Value = "Investment Parameters:"
ws.Range("A4").Value = "Initial Investment:"
ws.Range("B4").Value = initialInvestment
ws.Range("B4").NumberFormat = "£#,##0.00"
ws.Range("A5").Value = "Annual Cash Flow:"
ws.Range("B5").Value = annualCashFlow
' ... 74 more lines hidden ...
'
' Sign up for free to view the complete code
' Visit: vbacode.io
Access all 45 templates
10 free AI generations/month
No credit card required
Related Topics
roi
investment
financial
scenarios
Need Custom VBA Solutions?
Our AI-powered VBA generator can create custom code tailored to your specific requirements in seconds.
Generate Custom VBA Code