How can i calculate the cost of the Loan with the Capital and interest rate? Vba : I´m doing a Intership as a Developer an got a tough exercise. I´ve got a Loan Text and there are 3 Fields blank, the Loan, the Capital and the interest rate. I´ve created already the and it look like this:

        Private Sub l_jahre_Click()
    
    End Sub
    
    Private Sub txt_abtrag_Change()
        CalculateFormular
    End Sub
    
    Private Sub txt_darlehen_Change()
        CalculateFormular
    End Sub
    
    Private Sub txt_zinssatz_Change()
        CalculateFormular
    End Sub
    
    Private Sub CalculateFormular()
        If (validate()) Then
            Debug.Print "Success"
        End If
    End Sub
    
    
    Private Function validate() As Boolean
        validate = True
        On Error GoTo x
        a = CDbl(txt_abtrag.Value) + CDbl(txt_darlehen.Value) + CDbl(txt_zinssatz.Value)
        Exit Function
    x:
        validate = False
    End Function
    
    Public Sub test2()
        'Debug.Print txt_zinssatz.Value
        l_zinsen.Caption = "inf."
    End Sub

Don´t mind the Value of them xd

And now I Need to calculate, like i said, the cost of the Loan with the Capital and interest rate.

I Need to fill it up and it Looks like this.

    Public Function GetTotalCost(ByVal capital As Double, ByVal rate As Double) As Double
        GetTotalCost = 0
    End Function
    
    Public Function GetRentTime(ByVal capital As Double, ByVal rate As Double, ByVal monthPay As Double) As Double
        GetRentTime = 0
    End Function

please don´t say the full Code or the full answer i just Need some help to understand and what method i should use.
Thank you for your help.
