Leverage the Power of Functional Programming in VBA
Dim dict As New Dicts
dict.map("_*2").filter("_>4")
Example :
- print out all the projects with a NPV > 5 to screen (discount rate 10%).
The spreadsheet "src" is as below.
1. Create a new instance
Dim d As New Dicts
2. Load the dict with data in the spreadsheet
With d.load("", 1, d.rng(2, d.x("", 1)), 2)
3. filter it functionally and elegantly
.ranged("?+_/1.1^({i}+1)", AggregateMethod.AggReduce).filter("_>5").p
End With
Having trouble with this project? You can contact yang('at')qiou('dot')eu and I will help you sort it out.