Bonjour au forum,
J'ai un soucis au niveau du recopiage d'une date à partir d'une Combobox (où le format est correct et celui désiré, soit "JJ/MM/AAAA") vers une cellule au format "date courte" mais où l'affichage après copie est sous forme "MM/JJ/AAAA".
Ci-dessous le code du bouton qui me permet de recopier mes valeurs du formulaire vers ma feuille :
Private Sub CmdAjout_Click()
Dim dlig As Long
Application.ScreenUpdating = False
If CBDate.Text = "" Or CBChef.Text = "" Or CBSujet.Text = "" Or TextBoxDatdeb = "" Or TextBoxDatfin = "" Then
MsgBox "blabla !", vbExclamation + vbOKOnly, "Attention !"
Exit Sub
End If
If Not IsDate(TextBoxDatdeb) And IsDate(TextBoxDatfin) Then
MsgBox "blabla !", vbExclamation + vbOKOnly, "Attention !"
TextBoxDatdeb = ""
TextBoxDatfin = ""
Exit Sub
End If
If CDate(TextBoxDatdeb) > CDate(TextBoxDatfin) Then
MsgBox "blabla!", vbExclamation + vbOKOnly, "Attention !"
Exit Sub
End If
With Sheets("Communications")
.Unprotect Password:="mdp"
dlig = .Range("C" & Rows.Count).End(xlUp).Row + 1
.Range("C" & dlig).Value = CBDate.Text
.Range("D" & dlig).Value = CBChef.Text
.Range("E" & dlig).Value = CBSujet.Text
.Range("F" & dlig).Value = TextBoxObj.Text
.Range("G" & dlig).Value = CDate(TextBoxDatdeb)
.Range("H" & dlig).Value = CDate(TextBoxDatfin)
.Protect Password:="mdp"
End With
Application.ScreenUpdating = True
End Sub
Mon problème concerne la combobox CBDate...
Auriez-vous une idée... ?
NB : Le fichier est très volumineux, contient énormément de données sensibles et je n'ai pour l'instant pas vraiment le temps d'en faire une version pour le forum... je m'en excuse d'avance et si cela est vraiment nécessaire pour l'aide je le ferai