A B C D E F G H I J K L M N    
2
3 Example Of Business Functions and VBA
4
5
6 Suppose you want your own custom loan function, that has a much simpler list of inputs that BF's
7 Loan() function.
8 You can write your own MyLoan function as follows:
9
Text Box: Function MyLoan(TimeBase, AdvanceDate, Advance, RepaymentDate, InterestRate, LoanOutput)
    MyLoan = Run("Loan", TimeBase, AdvanceDate, InterestRate, AdvanceDate, Advance, RepaymentDate, LoanOutput, 3, -4, 1)
End Function
10
11
12
13
14
15
16 AdvanceDate  1 Feb 08 Repayment Date  1 Feb 13
17 Advance   1,000 Interest Rate   7.00% 
18
19 Timebase  1 Jan 08  1 Jan 09  1 Jan 10  1 Jan 11  1 Jan 12  1 Jan 13
20
21 Principal     1,000         (1,000)
22 Interest 1 (47) (70) (70) (70) (70) (24)
23 Closing Balance 5   1,000   1,000   1,000   1,000   1,000  
24
25
26
27 Note that this is an array-entered function.
28 VBA functions are MUCH quicker when used as array functions.
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80