snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Private Sub TextBox8_Change()
If Me.TextBox8.Value = blank Then Exit Sub
With Me.TextBox8
chkval = IsNumeric(.Value)
If chkval = False Then
MsgBox ("ให้ใส่เฉพาะตัวเลขเท่านั้น")
.Text = Left(.Text, Len(.Text) - 1)
End If
End With
End Sub
Private Sub TextBox8_Change()
If Me.TextBox8.Value = blank Then Exit Sub
With Me.TextBox8
chkval = IsNumeric(.Value)
chkval = IsNumeric(.Value) And Len(.Value) = 13
If chkval = False Then
MsgBox ("ห้ใส่เฉพาะตัวเลขเท่านั้น")
.Text = Left(.Text, Len(.Text) - 1)
End If
End With
End Sub
Private Sub TextBox8_AfterUpdate()
TextBox8.Value = Format(TextBox8.Value, "0-0000-00000-00-0")
End Sub
'Private Sub TextBox8_Change()
' TextBox8.Text = Format(TextBox8.Text, "0-0000-00000-00-0")
'End Sub
'Private Sub TextBox8_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
Private Sub TextBox8_Change()
If Me.TextBox8.Value = blank Then Exit Sub
With Me.TextBox8
chkval = IsNumeric(.Value)
chkval = IsNumeric(.Value) And Len(.Value) = 13
If chkval = False Then
MsgBox ("ให้ใส่เฉพาะตัวเลขเท่านั้น")
.Text = Left(.Text, Len(.Text) - 1)
End If
End With
End Sub
You do not have the required permissions to view the files attached to this post.
Private Sub TextBox8_Change()
If Len(Me.TextBox8.Text) > 13 Then
Me.TextBox8.Text = Left(Me.TextBox8.Text, 13)
Exit Sub
End If
With Me.TextBox8
chkval = IsNumeric(.Value)
If chkval = False Then
MsgBox ("ให้ใส่เฉพาะตัวเลขเท่านั้น")
.Text = Left(.Text, Len(.Text) - 1)
End If
End With
End Sub