Public Function ValeurTBx(ByVal TBx As MSForms.TextBox, _
Optional ByVal TypeDon As VbVarType = vbDouble)
On Error Resume Next
If TBx.Text = "" Then
ValeurTBx = Empty
ElseIf TypeDon = vbDate Then
If TBx.Text Like "[a,d,f,j,m,s,o,n]*" Then
ValeurTBx = CDate("1 " & TBx.Text)
Else: ValeurTBx = CDate(TBx.Text): End If
ElseIf TypeDon = vbString Or Not IsNumeric(TBx.Text) Then
ValeurTBx = TBx.Text
ElseIf TypeDon = vbCurrency Then
ValeurTBx = CCur(TBx.Text)
Else
ValeurTBx = CDbl(TBx.Text)
End If
End Function
Public Function ValeurTBx(ByVal TBx As MSForms.TextBox, _
Optional ByVal TypeDon As VbVarType = vbDouble)
On Error Resume Next
If TBx.Text = "" Then
ValeurTBx = Empty
ElseIf TypeDon = vbDate Then
ValeurTBx = CDate(TBx.Text)
ElseIf TypeDon = vbString Or Not IsNumeric(TBx.Text) Then
ValeurTBx = TBx.Text
ElseIf TypeDon = vbCurrency Then
ValeurTBx = CCur(TBx.Text)
Else
ValeurTBx = CDbl(TBx.Text)
End If
End Function
TVLF(1, 81) = CDate("1/" & Me.TBxCDatreal1.Text)
TVLF(1, 82) = CDate("1/" & Me.TBxCDatfin1.Text)
TVLF(1, 83) = ValeurTBx(Me.TBxCRest1, vbCurrency)
TVLF(1, 84) = Me.TBxCNom2.Text
TVLF(1, 85) = Me.CBxCNat2.Text
TVLF(1, 86) = CDate("1/" & Me.TBxCDatreal2.Text)
TVLF(1, 87) = CDate("1/" & Me.TBxCDatfin2.Text)
TVLF(1, 88) = ValeurTBx(Me.TBxCRest2, vbCurrency)
TVLF(1, 89) = Me.TBxCNom3.Text
TVLF(1, 90) = Me.CBxCNat3.Text
TVLF(1, 91) = CDate("1/" & Me.TBxCDatreal3.Text)
TVLF(1, 92) = CDate("1/" & Me.TBxCDatfin3.Text)
TVLF(1, 93) = ValeurTBx(Me.TBxCRest3, vbCurrency)
TVLF(1, 94) = Me.TBxCNom4.Text
TVLF(1, 95) = Me.CBxCNat4.Text
TVLF(1, 96) = CDate("1/" & Me.TBxCDatreal4.Text)
TVLF(1, 97) = CDate("1/" & Me.TBxCDatfin4.Text)
TVLF(1, 98) = ValeurTBx(Me.TBxCRest4, vbCurrency)
TVLF(1, 99) = Me.TBxCNom5.Text
TVLF(1, 100) = Me.CBxCNat5.Text
TVLF(1, 101) = CDate("1/" & Me.TBxCDatreal5.Text)
TVLF(1, 102) = CDate("1/" & Me.TBxCDatfin5.Text)
TVLF(1, 103) = ValeurTBx(Me.TBxCRest5, vbCurrency)
TVLF(1, 104) = ValeurTBx(Me.TBxCPens, vbCurrency)