I already ask the user to key In ID and the cell will be select automatically. next is how to prevent the excel from closing when data is key in remotely in the selected column?
Code:
Sub Enter_1()
Dim data_1 As String
Dim sCell As Variant
Dim rslt As Integer
Dim x As Integer
Do
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
data_1 = InputBox(Prompt:="Enter Employee No.", Title:="Employee", Default:="Enter Employee No. here")
If data_1 = "" Then
QuestionToMessageBox = "Exit?"
YesOrNoAnswerToMessageBox = MsgBox(QuestionToMessageBox, vbYesNo, "No")
End If
If YesOrNoAnswerToMessageBox = vbNo Then
data_1 = InputBox(Prompt:="Enter Employee No.", Title:="Employee", Default:="Enter Employee No. here")
Exit sub
End If
If Not IsNumeric(data_1) Or data_1 = "" Then
rslt = 0
Else: rslt = 1
End If
If rslt = 0 Then
MsgBox "You can only enter a number in this field"
Else:
Sheets("Oven After Assay Test").Activate
For x = 6 To 50
If Cells(x, 8).Value = "" Then
Cells(x, 8).Select
cancel = True
Exit For
End If
Next
End If
Loop While rslt = 0
End Sub