Bonjour tout le monde,
me voila avec un petit problème que je n’arrive pas à résoudre.
Sous Office 365 cela fonctionne, mais comme on travaille également sous Office 2021, et là ça ne fonctionne plus !
Explications :
Ci-dessous vous avez le code du UserForm en question.
Private Sub ANNULER_Click()
TextBox1 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox10 = ""
TextBox12 = ""
TextBox14 = ""
TextBox15 = ""
TextBox16 = ""
ComboBox2 = ""
ComboBox10 = ""
ComboBox12 = ""
End Sub
Private Sub CommandButton91_Click()
Dim J As Long, i As Integer, No_ID As String, Dl%, DerLigne%
On Error Resume Next
With [Tab_1]
If .Item(J, 1) <> "" Then J = .Rows.Count + 1 Else J = 1
No_ID = "R" & Format(J, "0000")
.Item(J, 1) = No_ID
.Item(J, 2) = UCase(ComboBox10)
.Item(J, 3) = TextBox1.Text
.Item(J, 4) = TextBox14.Text
.Item(J, 5) = TextBox15.Text
.Item(J, 6) = ComboBox13.Text
.Item(J, 6) = ComboBox2.Text
.Item(J, 6) = ComboBox12.Text
.Item(J, 7) = CDbl(TextBox3)
.Item(J, 8) = CDbl(TextBox4)
.Item(J, 9) = CDbl(Application.WorksheetFunction.Substitute(TextBox5.Value, ".", ","))
.Item(J, 11) = CDate(TextBox6)
.Item(J, 11).NumberFormat = "m/d/yyyy"
.Item(J, 12) = CDbl(TextBox10)
.Item(J, 19) = TextBox17.Text
MsgBox "Nouvel article enregistré dans le stock."
End With
If MsgBox("Voulez-vous créer un autre nouvel article ?", vbYesNo) = vbYes Then
Tri_Stock
ReIndex_ID
COMMANDE_SIMPLE.InitListBox
COMMANDE_PAR_MENUS.InitListBox
Else
Tri_Stock
ReIndex_ID
COMMANDE_SIMPLE.InitListBox
COMMANDE_PAR_MENUS.InitListBox
Unload Me
End If
End Sub
Private Sub CommandButton92_Click()
Unload Me
GESTION_STOCK.Show
End Sub
Private Sub UserForm_Initialize()
'Ote la croix de l'userform - Code Option Explicit dans module MOT_DE_PASSE
OteCroix Me.Caption
TextBox5 = Format(TextBox5, "#,###,##0.000 €")
TextBox12 = Format(TextBox12, "#,###,##0.000 €")
With [Tab_1[Rayons]]
For i = 1 To .Rows.Count
ComboBox10 = .Item(i, 1)
'...et filtre les doublons
If ComboBox10.ListIndex = -1 Then ComboBox10.AddItem .Item(i, 1)
Next i
End With
ComboBox10.ListIndex = -1
With [Tab_1[Unité]]
For i = 1 To .Rows.Count
ComboBox2 = .Item(i, 1)
'...et filtre les doublons
If ComboBox2.ListIndex = -1 Then ComboBox2.AddItem .Item(i, 1)
Next i
End With
ComboBox2.ListIndex = -1
With [Tab_1[Unité]]
For i = 1 To .Rows.Count
ComboBox12 = .Item(i, 1)
'...et filtre les doublons
If ComboBox12.ListIndex = -1 Then ComboBox12.AddItem .Item(i, 1)
Next i
End With
ComboBox12.ListIndex = -1
With [Tab_1[Unité]]
For i = 1 To .Rows.Count
ComboBox13 = .Item(i, 1)
'...et filtre les doublons
If ComboBox13.ListIndex = -1 Then ComboBox13.AddItem .Item(i, 1)
Next i
End With
ComboBox13.ListIndex = -1
Tri_Stock
ReIndex_ID
End Sub
Private Sub TextBox4_Change()
If TextBox4 <> "" Then
If IsNumeric(TextBox4) = False Then
MsgBox ("Saisie incorrecte !!!")
TextBox4 = ""
End If
Else
TextBox12 = ""
End If
If TextBox4 <> "" And TextBox5 <> "" Then
TextBox12 = Format(TextBox4 * TextBox5, "#.#000 €")
TextBox12 = Format(TextBox12, "#,##0.000 €")
End If
End Sub
Private Sub TextBox5_Change()
If TextBox5 <> "" Then
If IsNumeric(TextBox5) = False Then
MsgBox ("Saisie incorrecte !!!")
TextBox5 = ""
End If
Else
TextBox12 = ""
End If
If TextBox4 <> "" And TextBox5 <> "" Then
TextBox12 = Format(TextBox4 * TextBox5, "#.#000 €")
TextBox12 = Format(TextBox12, "#,##0.000 €")
End If
End Sub
Si je saisi en textbox5 le prix, par exemple 5.208 il me dit saisie incorrecte.
Alors que sous Office365 cela fonctionne.
Dans les options fichier j’ai mis ce que vous verrez sur l’image ci-dessous.
Pourriez vous m’aider s’il vous plaît.
Merci d’avance à vous.
Rubis