If ComboBox3.Value = 3 Then
TextBox7.Visible = True
Else
TextBox7.Visible = False
End If
Private Sub TextBox7_Change()
TextBox7.Value = Format(TextBox7.Value, "# ##0.00 ml")
End Sub
Sub Macro1()
'1) test avec l'enregistreur de macros
Range("A1") = 10.5
Range("A1").NumberFormat = "#,##0.00"" ml"""
'2) ci qui nous permet de déduire:
Dim Chaine$
Chaine = 10.5
MsgBox Chaine, vbInformation, "1"
MsgBox Format(Chaine, "#,##0.00"" ml"""), vbExclamation, "2"
'3) Je te laisse utiliser la syntaxe de Format pour tes TextBoxs
End Sub
Private Sub TextBox7_Change()
Range("AD2").NumberFormat = "#,##0.00"" ml"""
TextBox7.Value = Format(Range("AD2").Value, "#,##0.00"" ml""")
End Sub
Private Sub TextBox7_Change()
TextBox7.Value = Format(TextBox7.Value, "#,##0.00"" ml""")
End Sub
Re
Ilino
J'aurais plutôt tester ceci, non ?
Ce qui devrait être légèrement irritant à l'usageCode:Private Sub TextBox7_Change() TextBox7.Value = Format(TextBox7.Value, "#,##0.00"" ml""") End Sub
Private Sub TextBox7_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim dl&
dl = Cells(Rows.Count, "AD").End(xlUp).Row + 1
With Range("AD" & dl)
.Value = Format(TextBox7.Value, "#,##0.00"" ml""")
.NumberFormat = "#,##0.00"" ml"""
End With
End Sub
Re
Ilino
J'aurais plutôt tester ceci, non ?
Ce qui devrait être légèrement irritant à l'usageCode:Private Sub TextBox7_Change() TextBox7.Value = Format(TextBox7.Value, "#,##0.00"" ml""") End Sub
Private Sub TextBox7_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox7 = Format(TextBox7.Value, "#,##0.00"" ml""")
End Sub