Dim intRate As Integer
Dim intNper As Integer
Dim intPV As Integer
Dim intPMT As Integer
Dim intTOT As Integer
[COLOR="Red"]'Use 2^n numbering system to code
'which values are present[/COLOR]
If IsNumeric(Me.MonthlyRate) Then intRate = 8
If IsNumeric(Me.Nper_Months) Then intNper = 4
If IsNumeric(Me.PVal) Then intPV = 2
If IsNumeric(Me.Payment) Then intPMT = 1
intTOT = intRate + intNper + intPV + intPMT
[COLOR="red"]'use the code to determine which calculation to perform[/COLOR]
Select Case intTOT
Case 7 'calc Rate
Me.MonthlyRate = Rate(Me.Nper_Months, -Me.Payment, Me.PVal)
Case 11 'calc Nper
Me.Nper_Months = NPer(Me.MonthlyRate, -Me.Payment, Me.PVal)
Case 13 'calc PVal
Me.PVal = PV(Me.MonthlyRate, Me.Nper_Months, -Me.Payment)
Case 14 'calc Payment
Me.Payment = PMT(Me.MonthlyRate, Me.Nper_Months, -Me.PVal)
Case 15 'too many entries
MsgBox "Remove data from value to be calculated"
End Select