-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGenerate_Plot_percentiles.bas
30 lines (23 loc) · 1.1 KB
/
Generate_Plot_percentiles.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Attribute VB_Name = "Module3"
Sub Generate_Plot_percentiles()
'
' Generate_Plot_percentiles Macro
' This macro generates plots for each distribution and the percentiles for the given data
'
' Keyboard Shortcut: Ctrl+p
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Generating Percentiles for the distribution
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Range("L4").Select
ActiveCell.FormulaR1C1 = _
"=PERCENTILE(MonteCarloSimulation!R3C11:R100000C11, 0.1)"
Range("L5").Select
ActiveCell.FormulaR1C1 = _
"=PERCENTILE(MonteCarloSimulation!R3C11:R100000C11, 0.5)"
Range("L6").Select
ActiveCell.FormulaR1C1 = _
"=PERCENTILE(MonteCarloSimulation!R3C11:R100000C11, 0.9)"
Range("L4:L6").Select
Selection.NumberFormat = "#,##0.00"
End Sub