snasui.com ยินดีต้อนรับ ยินดีต้อนรับสู่กระดานถามตอบ Excel and VBA และอื่น ๆ ที่เป็นมิตรกับทุกท่าน มีไฟล์แนบมหาศาล ช่วยให้ท่านค้นหาและติดตามศึกษาได้โดยง่าย สมาชิกท่านใดที่ยังไม่ได้ระบุ Version ของ Excel ที่ใช้งานจริง สามารถทำตาม Link นี้เพื่อจะได้รับคำตอบที่ตรงกับ Version ของท่านครับ ระบุ Version ของ Excel
Private Sub CommandButton1_Click()
If TextBox2.Text <> Format(TextBox2.Text, "dd/mm/yyyy") Then
MsgBox "please input format : dd/mm/yyyy"
TextBox2.Text = ""
TextBox2.SetFocus
Else
Dim date1 As Date
date1 = TextBox2.Text
If date1 < Date Then
MsgBox "Part Number : " & TextBox1 & " is expire"
TextBox2.Text = ""
TextBox2.SetFocus
Else
MsgBox "Part Number : " & TextBox1 & " is not expire"
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
End If
End If
End Sub
You do not have the required permissions to view the files attached to this post.
Private Sub CommandButton1_Click()
If TextBox2.Text <> Format(TextBox2.Text, "dd/mm/yyyy") Then
MsgBox "please input format : dd/mm/yyyy"
TextBox2.Text = ""
TextBox2.SetFocus
Else
Dim date1 As Date
date1 = TextBox2.Text
If date1 < Date Then
MsgBox "Part Number : " & TextBox1 & " is expire"
TextBox2.Text = ""
TextBox2.SetFocus
Else
MsgBox "Part Number : " & TextBox1 & " is not expire"
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
End If
End If
End Sub
Private Sub CommandButton1_Click()
If TextBox2.Text <> Format(TextBox2.Text, "dd/mm/yyyy") Then
MsgBox "please input format : dd/mm/yyyy"
TextBox2.Text = ""
TextBox2.SetFocus
Else
Dim date1 As Date
date1 = TextBox2.Text
If date1 < Date Then
MsgBox "Part Number : " & TextBox1 & " is expire"
TextBox2.Text = ""
TextBox2.SetFocus
Else
MsgBox "Part Number : " & TextBox1 & " is not expire"
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
End If
End If
End Sub
Private Sub CommandButton1_Click()
If TextBox2.Text <> Format(TextBox2.Text, "dd/mm/yyyy") Then
MsgBox "please input format : dd/mm/yyyy"
TextBox2.Text = ""
TextBox2.SetFocus
Else
Dim date1 As Date
date1 = TextBox2.Text
If date1 < Date Then
MsgBox "Part Number : " & TextBox1 & " is expire"
TextBox2.Text = ""
TextBox2.SetFocus
Else
MsgBox "Part Number : " & TextBox1 & " is not expire"
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
End If
End If
End Sub
Private Sub CommandButton1_Click()
If TextBox2.Text = "" Then
MsgBox "please input format : dd/mm/yyyy"
TextBox2.Text = ""
TextBox2.SetFocus
Else
If TextBox2.Text <> Format(TextBox2.Text, "dd/mm/yyyy") Then
MsgBox "please input format : dd/mm/yyyy"
TextBox2.Text = ""
TextBox2.SetFocus
Else
On Error GoTo error1
Dim date1 As Date
date1 = TextBox2.Text
If date1 < Date Then
MsgBox "Part Number : " & TextBox1 & " is expire"
TextBox2.Text = ""
TextBox2.SetFocus
Exit Sub
Else
MsgBox "Part Number : " & TextBox1 & " is not expire"
TextBox1.Text = ""
TextBox2.Text = ""
TextBox1.SetFocus
Exit Sub
error1: MsgBox "not today in calendar"
TextBox2.Text = ""
TextBox2.SetFocus
End If
End If
End If
End Sub