Format date textbox et nom pas texte

BONJOUR

MERCIER DE MAIDER POUR CE PROBLEME.

j'utilise des textbox pour saisire des dates

1 probleme: quand je remplie le textbox 01/07/2018 et je valide dans la cellules change le format 07/01/2018

65sav-v.xlsm (84.38 Ko)

Bonjour Radhouane,

C'est que ta date se met au format "Anglais" : Les mois devant les jours, puis les années.

Pour y remédier :

Cells(1, 1) = Format(TextBox1.Value, "mm/dd/yyyy")

Restant à dispo

svp j arrive pas a modifier mon code

vous pouvez me le modifier afin que

textbox4 renvoie une date dd/mm/yyyy

textbox9 renvoie une date dd/mm/yyyy

textbox12 renvoie une date dd/mm/yyyy

textbox15 renvoie une date dd/mm/yyyy

textbox16 renvoie une date dd/mm/yyyy

textbox17 renvoie une date dd/mm/yyyy

'***************************

'Modifier le bon d'entree

'***********************

Private Sub CommandButton2_Click()

Dim LIGNE As Integer

LIGNE = ComboBox1.ListIndex + 2

If ComboBox1.Value = "" Then

MsgBox ("VEUILLEZ REMPLIR LE CHAMP RECHERCHE")

Else

Cells(LIGNE, 1) = TextBox1.Value

Cells(LIGNE, 2) = TextBox2.Value

Cells(LIGNE, 3) = TextBox3.Value

Cells(LIGNE, 4) = TextBox4.Value

Cells(LIGNE, 5) = TextBox5.Value

Cells(LIGNE, 6) = TextBox6.Value

Cells(LIGNE, 7) = TextBox7.Value

Cells(LIGNE, 8) = TextBox8.Value

Cells(LIGNE, 9) = TextBox9.Value

Cells(LIGNE, 10) = TextBox10.Value

Cells(LIGNE, 11) = TextBox11.Value

Cells(LIGNE, 12) = TextBox12.Value

Cells(LIGNE, 13) = TextBox13.Value

Cells(LIGNE, 14) = TextBox14.Value

Cells(LIGNE, 15) = TextBox15.Value

Cells(LIGNE, 16) = TextBox16.Value

Cells(LIGNE, 17) = TextBox17.Value

Cells(LIGNE, 18) = TextBox18.Value

End If

End Sub

Re-

Il fallait modifier ton code comme ci-dessous :

Private Sub CommandButton2_Click()
Dim LIGNE As Integer
LIGNE = ComboBox1.ListIndex + 2
If ComboBox1.Value = "" Then
MsgBox ("VEUILLEZ REMPLIR LE CHAMP RECHERCHE")
Else
Cells(LIGNE, 1) = Format(TextBox1.Value, "mm/dd/yyyy")
Cells(LIGNE, 2) = Format(TextBox2.Value, "mm/dd/yyyy")
Cells(LIGNE, 3) = Format(TextBox3.Value, "mm/dd/yyyy")
Cells(LIGNE, 4) = Format(TextBox4.Value, "mm/dd/yyyy")
Cells(LIGNE, 5) = Format(TextBox5.Value, "mm/dd/yyyy")
Cells(LIGNE, 6) = Format(TextBox6.Value, "mm/dd/yyyy")
Cells(LIGNE, 7) = Format(TextBox7.Value, "mm/dd/yyyy")
Cells(LIGNE, 8) = Format(TextBox8.Value, "mm/dd/yyyy")
Cells(LIGNE, 9) = Format(TextBox9.Value, "mm/dd/yyyy")
Cells(LIGNE, 10) = Format(TextBox10.Value, "mm/dd/yyyy")
Cells(LIGNE, 11) = Format(TextBox11.Value, "mm/dd/yyyy")
Cells(LIGNE, 12) = Format(TextBox12.Value, "mm/dd/yyyy")
Cells(LIGNE, 13) = Format(TextBox13.Value, "mm/dd/yyyy")
Cells(LIGNE, 14) = Format(TextBox14.Value, "mm/dd/yyyy")
Cells(LIGNE, 15) = Format(TextBox15.Value, "mm/dd/yyyy")
Cells(LIGNE, 16) = Format(TextBox16.Value, "mm/dd/yyyy")
Cells(LIGNE, 17) = Format(TextBox17.Value, "mm/dd/yyyy")
Cells(LIGNE, 18) = Format(TextBox18.Value, "mm/dd/yyyy")
End If
End Sub

Restant à dispo

merci beaucoup c fonctionne

Super

Reviens vers nous en cas de problème ;D

Bonjour

J ai 3 textbox

Textbox1 contient date entrée e au service après es vente

Textbox2 contient date vente

Textbox3 je veux quel affiche sous garantie ou bien hors garantie selon la difference des deux dates

Sous garantie < 1 an

Hors garantie >= 1 an

Re-

Désolé pour la lenteur de mon retour.

Si sa t’intéresse toujours, voici le code qu'il te faut ainsi qu'un fichier exemple :

Private Sub TextBox1_Change()
TextBox3.Value = ""
Call Garantie
End Sub
Private Sub TextBox2_Change()
TextBox3.Value = ""
Call Garantie
End Sub
Sub Garantie()
If TextBox1.Value = "" Or TextBox2.Value = "" Then Exit Sub
If Len(TextBox1.Value) <> 10 Or Len(TextBox2.Value) <> 10 Then Exit Sub
If DateDiff("y", TextBox1.Value, TextBox2.Value) > 365 Then
    TextBox3.Value = "Hors Garantie"
Else
    TextBox3.Value = "Sous Garantie"
End If
End Sub

En gros tu compte la différence (en jours) entre ta TextBox1 et ta TextBox2 !

Restant à dispo !

37pour-radhouane.xlsm (20.31 Ko)

Bonjour

tu pose la question plusieurs fois ???

et voila la dernier version avec la gestion des date & dernier envoie

a toi de voir

A+

Maurice

47sav-v1.xlsm (229.94 Ko)

Salut archer,

Bonjour

tu pose la question plusieurs fois ???

C'est-à-dire :0 ?

Salut archer,

Bonjour

tu pose la question plusieurs fois ???

C'est-à-dire :0 ?

C'est un double post : https://forum.excel-pratique.com/viewtopic.php?f=2&t=116484&p=705650#p705650

Bonjour

ses pas toi Juice désoler

radhouane a deja fait cette demande

A+

Maurice

C'est un double post : viewtopic.php?f=2&t=116484&p=705650#p705650

Bonjour

ses pas toi Juice désoler

radhouane a deja fait cette demande

A+

Maurice

Aaah d'acc d'acc !

Désolé x)

J'ai cru avoir fais une bourde !

C'est de plus en plus fréquent les gens qui ouvrent plusieurs fois la même demande '-'

#LucieBRETON

Rechercher des sujets similaires à "format date textbox nom pas texte"