andrewvanmarle
New Member
- Joined
- Aug 11, 2015
- Messages
- 40
I have a userform which when illed in will result in a certain set of fields filled in an excel. (an invoice)
The calculation works fine, but where I fail right now is to get the description working right.
if someone ticks the 50% radiobutton in the form then a 0.5 variable is filled in the calculation but also the description should read
courtage conform afspraak á 50% van 1% over € 100.000 ,=, the same goes for the 60% radiobutton.
The underlined parts are courtage.value and koopsom.value, those work fine too.
My problem is that I want the bold part to be 50% van, incase procent50 is true,60% van incase the procent60 is true and Null if neither are true (third radiobutton)
how do I insert that variable into the code below? I tried with verdelingtekst, but I keep getting errors
Thanks!!
The calculation works fine, but where I fail right now is to get the description working right.
if someone ticks the 50% radiobutton in the form then a 0.5 variable is filled in the calculation but also the description should read
courtage conform afspraak á 50% van 1% over € 100.000 ,=, the same goes for the 60% radiobutton.
The underlined parts are courtage.value and koopsom.value, those work fine too.
My problem is that I want the bold part to be 50% van, incase procent50 is true,60% van incase the procent60 is true and Null if neither are true (third radiobutton)
how do I insert that variable into the code below? I tried with verdelingtekst, but I keep getting errors
Thanks!!
Code:
If procent50 = True Thenverdeling = 0.5
verdelingtekst = "50% van"
Else
If procent60 = True Then
verdeling = 0.6
verdelingtekst = "60% van"
Else
verdeling = 1
verdelingtekst = Null
End If
End If
If incbtw = True Then
btw = 1.21
Else
btw = 1
End If
If Me.koopsom = vbNullString Then
Else
x = 17
Do Until Cells(x, 2) = ""
x = x + 1
Loop
bedrag = ((courtage / 100) * koopsom * verdeling) / btw
bedrag.Value = Format(bedrag.Value, "#,###.##")
ActiveSheet.Range("E" & x).Value = bedrag.Value
ActiveSheet.Range("D" & x).Value = "Courtage conform afspraak à " & courtage.Value & " % over € " & koopsom.Value & ",="
ActiveSheet.Range("B" & x).Value = 1
ActiveSheet.Range("E" & x) = CDbl(ActiveSheet.Range("E" & x))
End If