Just to update, THANKS MSP77079! Based on your response in another thread, I was able to fix my problem.
http://www.excelforum.com/showpost.p...34&postcount=5
Using your reply, I came up with the following (abbreviated):
AuditorName = InputBox("Enter your name is it appears on the Production Log.", "Associate Name")
matchRow = 0
On Error Resume Next
matchRow = Application.WorksheetFunction.Match(UCase(AuditorName), Range("B1:B13"), 0)
If matchRow = 0 Then
AuditorName = InputBox("The name entered does not match the Production Log. Please re-enter your name.", "Name Error")
On Error Resume Next
matchRow = Application.WorksheetFunction.Match(UCase(AuditorName), Range("B1:B13"), 0)
If matchRow = 0 Then
rowError = MsgBox("Please check your name and try again. No time has been recorded." & Chr(13) & Chr(13) & "Contact XXX for assistance.", vbOKOnly, "Name Input Error")
Exit Sub
End If
End If
ProvNo = InputBox("Enter the IL provider number (14-XXXX).", "Provider Number")
matchProvNo = 0
On Error Resume Next
matchProvNo = Application.WorksheetFunction.Match(ProvNo, Range("B1:B7"), 0)
If matchProvNo = 0 Then
ProvNo = InputBox("The provider number does not match the Production Log. Please re-enter the provider number in the ""14-XXXX"" format.", "Provider Number Error")
On Error Resume Next
matchProvNo = Application.WorksheetFunction.Match(ProvNo, Range("B1:B7"), 0)
If matchProvNo = 0 Then
ProvNoError = MsgBox("Please check the provider number and try again. No time has been recorded." & Chr(13) & Chr(13) & "Contact XXX for assistance.", vbOKOnly, "Provider Number Input Error")
Exit Sub
End If
End If
InputDate = InputBox("Enter the date for which you would like to record time.", "Date")
Sheets("Time_" & ProvNo).Select
Let Cells(25, 1).Value = InputDate
dDate = Format(Cells(25, 1), "mm/dd/yyyy")
matchCol = 0
On Error Resume Next
matchCol = Application.WorksheetFunction.Match(dDate, Range("A1:GA1"), 0)
If matchCol = 0 Then
InputDate = InputBox("The date entered must be between 1/1/2007 and 6/30/2007. Please re-enter the date.", "Date Error")
Let Cells(25, 1).Value = InputDate
dDate = Format(Cells(25, 1), "mm/dd/yyyy")
On Error Resume Next
matchCol = Application.WorksheetFunction.Match(dDate, Range("B1:B13"), 0)
If matchCol = 0 Then
rowError = MsgBox("Please check the date and try again. No time has been recorded." & Chr(13) & Chr(13) & "Contact XXX for assistance.", vbOKOnly, "Date Input Error")
Exit Sub
End If
End If
Cells(matchRow, matchCol).Value = InputTime
Bookmarks