tại sao ô Price định dạng theo 12,3456
Private Sub TextBox_Price_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If Not IsNumeric(Chr(KeyAscii)) And KeyAscii <> 8 Then
KeyAscii = 0
If Not IsNumeric(TextBox_Price.Value) Then
MsgBox "Invalid price value"
TextBox_Price.Value = ""
End If
Else
TextBox_Price.Value = Format(CStr(TextBox_Price.Value), "#,##0")
End If
End Sub
Private Sub TextBox_Price_Change()
Me.TextBox_Price= Format(Format(TextBox_Price, "0"), "#,##0")
End Sub
Bạn để trong sự kiện change nhé.