title: I was trying to calculate Simple interest amount in VBA by using functions, but it's not working
body: <pre><code>Function InterestAmount(pdblPrincipal As Double, pdblTime As Double, pdblRate As Double, pdblInterestAmount As Double)
  
      If IsMissing(pdblRate) Then
      MsgBox &quot;Your loan amount is: &quot; &amp; pdblPrincipal
      Else
      pdblInterestAmount = ((pdblPrincipal * pdblTime * pdblRate) / 100)
      End If
      
      ldblInterestAmount = pdblInterestAmount
  
  End Function
  
  Function CalculateInterestAmount(Principal As Double, Time As Double, Rate As Double)
  
  Dim ldblPrincipal As Double
  Dim ldblTime As Double
  Dim ldblRate As Double
  Dim ldblInterestAmount As Double
  
      ldblInterestAmount = 0
      ldblPrincipal = Principal
      ldblTime = Time
      ldblRate = Rate
      Call InterestAmount(ldblPrincipal, ldblTime, ldblRate, ldblInterestAmount)
      Debug.Print ldblInterestAmount
      
  End Function
  </code></pre>