I am experiencing issues closing a userform that I am using as an information pop-up for users when selecting a specific mode in a different userform. I would like the pop-up (LAT_Notice) to present itself for a specified time period after clicking on CommandButton_1. Once the button is clicked, the code verifies that each textbox has values within (I realize I probably did not use the most efficient means here, but it works and I understand it at least) and lastly, checks to see if the mode has the wording "LAT" within. If LAT is found, it presents the LAT_Notice with the informational message. This is what I want timed. Any help is appreciated...
Code:
Private Sub CommandButton1_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("Test Plan")
With ws
ActiveSheet.Unprotect Password:="TEST"
.Range("c3") = Me.Description.Value
.Range("i3") = Me.RespEngAppr.Value
.Range("l3") = Me.EngPhone.Value
.Range("bz1") = Me.TestEng.Value
.Range("bz2") = Me.ProjectNo.Value
.Range("bz3") = Me.AltContact.Value
.Range("bz4") = Me.AltPhone.Value
.Range("bz8") = Me.DueDate.Value
.Range("U8") = Me.TONo.Value
.Range("D1").Value = ComboBox1.Value
'Coding for error message to pop up for lack of inputted data
If Me.TONo.Value = "" Then
MsgBox "You must complete the TO No field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.ComboBox1.Value = "" Then
MsgBox "You must complete the Test Type field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.Description.Value = "" Then
MsgBox "You must complete the Description field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.RespEngAppr.Value = "" Then
MsgBox "You must complete the Responsible Engineer field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.EngPhone.Value = "" Then
MsgBox "You must complete the Engineer Phone field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.TestEng.Value = "" Then
MsgBox "You must complete the Test Engineer field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.ProjectNo.Value = "" Then
MsgBox "You must complete the Project No. field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.AltContact.Value = "" Then
MsgBox "You must complete the Alternate Contact field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.AltPhone.Value = "" Then
MsgBox "You must complete the Alternate Contact Phone field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.DueDate.Value = "" Then
MsgBox "You must complete the Due Date field before Inputting Data", vbCritical
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
Exit Sub
End If
If Me.ComboBox1.Value = "LAT" Then
LAT_Notice.Show
Application.Wait (Now + TimeValue("00:00:02"))
Exit Sub
End If
' End of Coding for error message to pop up for lack of inputted data
ActiveSheet.Protect Password:="TEST", AllowInsertingRows:=True, AllowDeletingRows:=True
End With
End Sub