rivate Sub UserForm_Initialize()
' CONCERNCE : Procédure de Chargement du formulaire
' ********************************************
Application.ScreenUpdating = False
Application.Calculation = xlCalculationAutomatic
' Désactiver le formulaire à l'ouverture
' --------------------------------------------------
' For i = 1 To 4
' Me.Controls("Frame" & i).Enabled = False
' Next
' For i = 6 To 7
' Me.Controls("Frame" & i).Enabled = False
' Next
' ENREGISTRER.Enabled = False
' Me.Frame8.Enabled = False
' Me.Frame9.Enabled = False
' Titre du Formulaire et informations clé de base
' ---------------------------------------------------------
' FRAME N° 1 : Des informations juridiques par défaut sur le dossier
' --------------------------------------------------------------------------------
' FRAME N°2 : Des informations comptables et fiscales par défaut
' ----------------------------------------------------------------------------------------
' FRAME N°3 : Autres info administratives sur le dossier
' ----------------------------------------------------------------------------------
' FRAME N°4 : Des visas et sécurités des clôtures
' -----------------------------------------------------------------
' FRAME N°7 : De l'Inventaire N-1
' --------------------------------------------
USF18_TextBox1.Value = [INV_NbB10000].Value
USF18_TextBox2.Value = [INV_NbB5000].Value
USF18_TextBox3.Value = [INV_NbB2000].Value
USF18_TextBox4.Value = [INV_NbB1000].Value
USF18_TextBox5.Value = [INV_NbB500].Value
USF18_TextBox6.Value = [INV_NbP500].Value
USF18_TextBox7.Value = [INV_NbP100].Value
USF18_TextBox8.Value = [INV_NbP50].Value
USF18_TextBox9.Value = [INV_NbP25].Value
USF18_TextBox10.Value = [INV_NbP10].Value
USF18_TextBox11.Value = [INV_NbP5].Value
USF18_TextBox12.Value = [INV_NbP2].Value
USF18_TextBox13.Value = [INV_NbP1].Value
' -------------------------------------------------------------'
' Format pièces '
' -------------------------------------------------------------'
Label192.Caption = Format(CDbl(USF18_TextBox1.Value * 10000), "### ### ##0 ")
Label193.Caption = Format(CDbl(USF18_TextBox2.Value * 5000), "### ### ##0 ")
Label194.Caption = Format(USF18_TextBox3.Value * 2000, "### ### ##0 ")
Label195.Caption = Format(USF18_TextBox4.Value * 1000, "### ### ##0 ")
Label196.Caption = Format(USF18_TextBox5.Value * 500, "### ### ##0 ")
Label197.Caption = Format(USF18_TextBox6.Value * 500, "### ### ##0 ")
Label198.Caption = Format(USF18_TextBox7.Value * 100, "### ### ##0 ")
Label199.Caption = Format(USF18_TextBox8.Value * 50, "### ### ##0 ")
Label200.Caption = Format(USF18_TextBox9.Value * 25, "### ### ##0 ")
Label201.Caption = Format(USF18_TextBox10.Value * 10, "### ### ##0 ")
Label202.Caption = Format(USF18_TextBox11.Value * 5, "### ### ##0 ")
Label203.Caption = Format(USF18_TextBox12.Value * 2, "### ### ##0 ")
Label204.Caption = Format(USF18_TextBox13.Value * 1, "### ### ##0 ")
Label205.Caption = Format((CDbl(Label192.Caption) + _
CDbl(Label193.Caption) + CDbl(Label194.Caption) + _
CDbl(Label195.Caption) + CDbl(Label196.Caption) + _
CDbl(Label197.Caption) + CDbl(Label198.Caption) + _
CDbl(Label199.Caption) + CDbl(Label200.Caption) + _
CDbl(Label201.Caption) + CDbl(Label202.Caption) + _
CDbl(Label203.Caption) + CDbl(Label204.Caption)), "### ### ##0 ")
' FRAME N°8 : Des Droits d'utilisation / Licence
' ---------------------------------------------------------------
Application.Calculation = xlManual
Application.DisplayAlerts = False
Application.ScreenUpdating = True
End Sub
Private Sub USF18_TextBox1_Change()
If Not IsNumeric(Me.USF18_TextBox1) Then
USF18_TextBox1.Value = ""
Else
Label192.Caption = Format(CDbl(USF18_TextBox1.Value * 10000), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox2_Change()
If Not IsNumeric(Me.USF18_TextBox2) Then
USF18_TextBox2.Value = ""
Else
Label193.Caption = Format(CDbl(USF18_TextBox2.Value * 5000), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox3_Change()
If Not IsNumeric(Me.USF18_TextBox3) Then
USF18_TextBox3.Value = ""
Else
Label194.Caption = Format(CDbl(USF18_TextBox3.Value * 2000), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox4_Change()
If Not IsNumeric(Me.USF18_TextBox4) Then
USF18_TextBox4.Value = ""
Else
Label195.Caption = Format(CDbl(USF18_TextBox4.Value * 1000), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox5_Change()
If Not IsNumeric(Me.USF18_TextBox5) Then
USF18_TextBox5.Value = ""
Else
Label196.Caption = Format(CDbl(USF18_TextBox5.Value * 500), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox6_Change()
If Not IsNumeric(Me.USF18_TextBox6) Then
USF18_TextBox6.Value = ""
Else
Label197.Caption = Format(CDbl(USF18_TextBox6.Value * 500), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox7_Change()
If Not IsNumeric(Me.USF18_TextBox7) Then
USF18_TextBox7.Value = ""
Else
Label198.Caption = Format(CDbl(USF18_TextBox7.Value * 100), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox8_Change()
If Not IsNumeric(Me.USF18_TextBox8) Then
USF18_TextBox8.Value = ""
Else
Label199.Caption = Format(CDbl(USF18_TextBox8.Value * 50), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox9_Change()
If Not IsNumeric(Me.USF18_TextBox9) Then
USF18_TextBox9.Value = ""
Else
Label200.Caption = Format(CDbl(USF18_TextBox9.Value * 25), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox10_Change()
If Not IsNumeric(Me.USF18_TextBox10) Then
USF18_TextBox10.Value = ""
Else
Label201.Caption = Format(CDbl(USF18_TextBox10.Value * 10), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox11_Change()
If Not IsNumeric(Me.USF18_TextBox11) Then
USF18_TextBox11.Value = ""
Else
Label202.Caption = Format(CDbl(USF18_TextBox11.Value * 5), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox12_Change()
If Not IsNumeric(Me.USF18_TextBox12) Then
USF18_TextBox12.Value = ""
Else
Label203.Caption = Format(CDbl(USF18_TextBox12.Value * 2), "# ### ###")
End If
End Sub
Private Sub USF18_TextBox13_Change()
If Not IsNumeric(Me.USF18_TextBox13) Then
USF18_TextBox13.Value = ""
Else
Label204.Caption = Format(CDbl(USF18_TextBox13.Value * 1), "# ### ###")
End If
End Sub
Private Sub Ville_Change()
Ville.Value = Application.WorksheetFunction.Proper(Ville)
End Sub
Private Sub Adresse_Change()
Adresse.Value = Application.WorksheetFunction.Proper(Adresse)
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then Cancel = 1
End Sub
' Je formule 3 souhaits:
' 1° qu'il me soit possible de réduire en une seule procédure, tous les événements TextBox_Change() des TextBox allant de USF18_TextBox1 à USF18_TextBox13
' 2° que la valeur de USF18.Label205.Caption en soit affectée automatiquement
' 3° qu'il eut été possible de réduire également par un code magique la formule-ci:
' Label205.Caption = Format((CDbl(Label192.Caption) + _
' CDbl(Label193.Caption) + CDbl(Label194.Caption) + _
' CDbl(Label195.Caption) + CDbl(Label196.Caption) + _
' CDbl(Label197.Caption) + CDbl(Label198.Caption) + _
' CDbl(Label199.Caption) + CDbl(Label200.Caption) + _
' CDbl(Label201.Caption) + CDbl(Label202.Caption) + _
' CDbl(Label203.Caption) + CDbl(Label204.Caption)), "### ### ##0 ")