XL 2013 Convertir une date

maval

XLDnaute Barbatruc
Bonjour,

J'ai sur un Usf dans lequel j'ai un bouton de recherche sur Internet et lorsque je valide j'ai toute les infos sur mon Usf . Dans un textbox j'ai la date qui s'affiche au format USA soit "2012-09-25" et j'aimerai que la date change automatiquement au format " 25 septembre 2012" si possible

Je vous remercie d'avance
 

maval

XLDnaute Barbatruc
Re : Convertir une date

Bonjour Job

Je vous remercie. Sur ma ligne de commande j'ai mis ceci:
Code:
f.Cells(ligneEnreg, "D") = Me.TextBox14 = Format(TextBox14, "dd mmmm yyyy")
et sa me retourne VRAI j'ai du me planter?

Bonne journée
 

job75

XLDnaute Barbatruc
Re : Convertir une date

Re,

Quant au type de macro vous avez l'embarras du choix :

Code:
Private Sub CommandButton1_Click()
TextBox1 = Format(TextBox1, "dd mmmm yyyy")
End Sub
Code:
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1 = Format(TextBox1, "dd mmmm yyyy")
End Sub
Code:
Private Sub TextBox1_Change()
If TextBox1 Like "####-##-##" Then TextBox1 = Format(TextBox1, "dd mmmm yyyy")
End Sub
A+
 

job75

XLDnaute Barbatruc
Re : Convertir une date

Re,

Pas vu votre post #3, vous vouliez donc formater une cellule :

Code:
If IsDate(TextBox14) Then
  With f.Cells(ligneEnreg, "D")
    .NumberFormat = "dd mmmm yyyy"
    .Value = CDate(TextBox14)
    .EntireColumn.AutoFit 'facultatif
    TextBox14 = .Text 'facultatif
  End With
End If
A+
 

Discussions similaires

Réponses
19
Affichages
740