Option Explicit
Private Sub LabelDate_Click()
fmSTD_Calendrier.SelectDateCTRL1 Me, LabelDate 'appel calendrier
If LabelDate <> "" Then
B_ok.Enabled = True
Else
B_ok.Enabled = False
End If
End Sub
Private Sub ComboBox1_Change()
With ComboBox1
If .ListIndex > -1 Then
TextBox1 = .List(.ListIndex, 1)
TextBox2 = Replace(.List(.ListIndex, 2), ",", ".") & " €"
End If
End With
End Sub
Private Sub UserForm_Initialize()
liste
End Sub
Sub liste()
With ComboBox1
.ColumnCount = 4
.List = Feuil1.Range("Tableau1").Value
.ColumnWidths = .Width & ";0;0;0"
End With
End Sub
Private Sub B_ok_Click()
Dim L As Long
With Sheets("Saisie").Range("A65000").End(xlUp).Offset(1)
.Value = Me.ComboBox1.Value
.Offset(, 1).Value = Val(Replace(Me.TextBox3, ",", ".")) 'ici la valeur envoyée n'est pas correctement affichée
.Offset(, 2).Value = Val(Replace(Me.TextBox2, ",", "."))
.Offset(, 3).Value = Val(Replace(Me.TextBox2, ",", ".")) * Val(Replace(Me.TextBox3, ",", ".")) 'montant saisie
End With
'**********************************
'a quoi ca sert ceci ci dessous????????
'Me.ComboBox1.SetFocus'???????????
'[D1] = Now
'temp = f3.[F65000].End(xlUp)
'If IsNumeric(temp) Then [C1] = temp + 1 Else [C1] = 1
'************************************
With Sheets("Archives")
L = .Range("G" & Rows.Count).End(xlUp).Row + 1
.Range("A" & L).Value = CDate(LabelDate)
.Range("B" & L).Value = Month(CDate(LabelDate))
.Range("C" & L).Value = Year(CDate(LabelDate))
.Range("D" & L).Value = ComboClients
.Range("E" & L).Value = ComboRèglement
.Range("G" & L).Value = ComboBox1
.Range("H" & L).Value = Val(Replace(Me.TextBox3, ",", "."))
.Range("I" & L).Value = Val(Replace(Me.TextBox2, ",", "."))
.Range("J" & L).Value = Val(Replace(Me.TextBox2, ",", ".")) * Val(Replace(Me.TextBox3, ",", ".")) 'montant archive
End With
With Me
.ComboBox1 = "": .TextBox1 = "": .TextBox2 = "": Me.TextBox3 = ""
End With
End Sub
Private Sub B_fin_Click()
Unload Me
End Sub