Microsoft 365 problème de dates UserForm

xhudi69

XLDnaute Accro
bonjour à tous
Je transfert des dates sur un userForm provenant d'une feuille de calcul, sur tous les postes de l'entreprise (50) cela se passe bien à l’exception de 2 postes (nouveaux) où les dates s'obstinent à s'afficher au format anglo-saxon, avez-vous une idée, je pense que c'est une histoire de paramétrage de la machine mais comment faire?

merci pour votre aide.
 

Staple1600

XLDnaute Barbatruc
Bonjour le fil

Juste pour faire des tests
VB:
Private Sub UserForm_Initialize()
[A1] = #11/13/2019#
MsgBox Format([A1], "dddd dd mmmm yyyy")
TextBox1 = CDate(Range("A1").Value2) + 1
TextBox2 = DateValue(Range("A1").Text) + 1
TextBox3 = Range("A1") + 1
End Sub
 

Staple1600

XLDnaute Barbatruc
Re

Avec cet autre test, ca pédale un peu dans la semoule ;)
VB:
Private Sub UserForm_Click()
Dim a$
a = Format(Range("A1").Value + 1, "dddd dd mmmm yyyy")
TextBox3.AutoSize = -1: TextBox2.AutoSize = -1: TextBox1.AutoSize = -1
TextBox3.Text = a: TextBox2.Text = a: TextBox1.Text = a
End Sub

Private Sub UserForm_Initialize()
'[A1] = #1/8/2019# '1 aout 2019 'test 1
[A1] = DateSerial(2019, 8, 1) 'test 2
MsgBox Format([A1], "dddd dd mmmm yyyy")
TextBox1 = CDate(Range("A1").Value2)
TextBox2 = DateValue(Range("A1").Text)
TextBox3.Text = Format(Range("A1").Value, "MM/dd/yyyy")
End Sub
 

xhudi69

XLDnaute Accro
Re...

MsgBox = jeudi 01 août 2019

Private Sub UserForm_Initialize()
TextBox1 = 01/08/2019
TextBox2 = 01/08/2019
TextBox3 = 08/01/2019

Private Sub UserForm_Click()
TextBox1 =vendredi 02 août 2019
TextBox2 = vendredi 02 août 2019
TextBox3 = vendredi 02 août 2019

@+
 

Staple1600

XLDnaute Barbatruc
Re

C'est ce qu'on pouvait croire, mais...:rolleyes:
VB:
Private Sub UserForm_Click()
Dim a$
a = Format(Range("A1").Value + 1, "dddd dd mmmm yyyy")
TextBox3.AutoSize = -1: TextBox2.AutoSize = -1: TextBox1.AutoSize = -1
TextBox3.Text = a: TextBox2.Text = a: TextBox1.Text = a
End Sub

Private Sub UserForm_Initialize()
[A1] = #1/8/2019# '1 aout 2019 'test 1
'[A1] = DateSerial(2019, 8, 1) 'test 2
MsgBox Format([A1], "dddd dd mmmm yyyy")
TextBox1 = CDate(Range("A1").Value2)
TextBox2 = DateValue(Range("A1").Text)
TextBox3.Text = Format(Range("A1").Value, "dd/mm/yyyy")
End Sub
 

xhudi69

XLDnaute Accro
Re...

MsgBox = mardi 08 janvier 2019

Private Sub UserForm_Initialize()
TextBox1 = 08/01/2019
TextBox2 = 08/01/2019
TextBox3 = 08/01/2019

Private Sub UserForm_Click()
TextBox1 = mercredi 09 janvier 2019
TextBox2 = mercredi 09 janvier 2019
TextBox3 = mercredi 09 janvier 2019

J'aime pas la semoule :mad:

@+
 

xhudi69

XLDnaute Accro
Re...

"Et c'est bien là ton problème, non ? "

oui et non, comme je l'ai dis mon code fonctionne très bien sur tous les postes -2
en outre les données au départ écrites sur la feuille le sont de façon correcte dans le bon format.

certaines données renvoyées sur l'UserForm, le sont à partir de Tablo et là même soucis.

@+
 

Discussions similaires

Statistiques des forums

Discussions
312 107
Messages
2 085 358
Membres
102 874
dernier inscrit
Petro2611