Re : ecrire 010107=01/01/2007 dans un textbox
re,
bonjour Jean-Marie, comment vas? cela fais longtemps.
ton code marches bien sur excel 2003 mais pas sur 2007.
il bloque sur trim, il connait pas dans le projet ou biblioteque.....
quel bazard sur 2007
Private Sub CmdValider_Click()
Dim nbligne, MsgErreur
Dim Remise As Double
Dim Remise2 As Double
Dim DateString As String
Dim Derlgn As Integer
If Me.TxtDate = "" Then Me.TxtDate.SetFocus: Exit Sub
DateString = Trim(TxtDate.Text)
Derlgn = Range("B500").End(xlUp).Row + 1
Range("B" & Derlgn) = DateSerial(mid(DateString, 5, 2), mid(DateString, 3, 2), mid(DateString, 1, 2))
Me.TxtDate = ""
If TxtN°Facture.Value = "" Then
MsgErreur = MsgBox(vbTab & "Saisissez un numéro de facture !", vbOKOnly + vbExclamation, "AJOUT IMPOSSIBLE, DONNEE OBLIGATOIRE")
TxtN°Facture.SetFocus
Exit Sub
End If
If CbxClient.Value = "" Then
MsgErreur = MsgBox(vbTab & "Choisissez un client !", vbOKOnly + vbExclamation, "AJOUT IMPOSSIBLE, DONNEE OBLIGATOIRE")
CbxClient.SetFocus
Exit Sub
End If
With Sheets("récap")
nbligne = .Range("A65536").End(xlUp).Row + 1
If OptBoulangerie = True Then
.Unprotect
.Range("A" & nbligne) = TxtN°Facture
' .Range("B" & nbligne) = CDate(Me.TxtDate.Value)
.Range("C" & nbligne) = CbxArticle_Boul.Value
.Range("D" & nbligne) = CDbl(TxtQuantite_Boul.Value)
.Range("E" & nbligne).NumberFormat = "#,##0.00€"
.Range("E" & nbligne) = CDbl(TxtPrix_Boul.Value) 'format(cdbl(txtprix_boul.value),"#,##0.00€")
.Range("L" & nbligne) = CDbl(CbxTva_Boul.Value)
.Range("O" & nbligne) = CbxClient.Value