Caveman1964
Board Regular
- Joined
- Dec 14, 2017
- Messages
- 127
- Office Version
- 2016
- Platform
- Windows
Hi, I appreciate all the help.
Here, I tried to enter the isdate function but can't seem to get it to work. So I took out and need help on how to have a line of code that requires this user to enter date format if the cell is empty. It works to say cell already has data but not to require date entry, lets them put anything. I did put effort into inserting isdate but I don't have declared right or something.
Novice here......Appreciate any help.
Thanks ahead.
Sub Enterdateintrosurveyreceived()
Sheets("Do Not Alter").Unprotect "1"
Sheets("Data Collection").Unprotect "1"
Sheets("Complaint Entry").Unprotect "1"
'Modified 11/10/2018 6:23:29 PM EST
Application.ScreenUpdating = False
Dim JobNumber As String
Dim SearchRange As Range
Dim NewDate As String
Sheets("Data Collection").Activate
JobNumber = InputBox("Please enter a Complaint Number", "Ampacet LSS Complaint Tracking System")
If Len(JobNumber) < 1 Then msgbox "No Value entered": Exit Sub
Set SearchRange = Range("A:A").find(JobNumber)
If SearchRange Is Nothing Then msgbox "Job number not found", vbExclamation, "Not found": Exit Sub
If Cells(SearchRange.Row, 17).Value = "" Then
NewDate = InputBox("Please enter the date", "Date")
Cells(SearchRange.Row, 17).Value = NewDate
Else
msgbox "The Value " & JobNumber & " Already Exists"
End If
Sheets("Complaint Entry").Select
Application.ScreenUpdating = True
Sheets("Do Not Alter").Protect "1", True, True
Sheets("Data Collection").Protect "1", True, True
Sheets("Complaint Entry").Protect "1", True, True
End Sub
Here, I tried to enter the isdate function but can't seem to get it to work. So I took out and need help on how to have a line of code that requires this user to enter date format if the cell is empty. It works to say cell already has data but not to require date entry, lets them put anything. I did put effort into inserting isdate but I don't have declared right or something.
Novice here......Appreciate any help.
Thanks ahead.
Sub Enterdateintrosurveyreceived()
Sheets("Do Not Alter").Unprotect "1"
Sheets("Data Collection").Unprotect "1"
Sheets("Complaint Entry").Unprotect "1"
'Modified 11/10/2018 6:23:29 PM EST
Application.ScreenUpdating = False
Dim JobNumber As String
Dim SearchRange As Range
Dim NewDate As String
Sheets("Data Collection").Activate
JobNumber = InputBox("Please enter a Complaint Number", "Ampacet LSS Complaint Tracking System")
If Len(JobNumber) < 1 Then msgbox "No Value entered": Exit Sub
Set SearchRange = Range("A:A").find(JobNumber)
If SearchRange Is Nothing Then msgbox "Job number not found", vbExclamation, "Not found": Exit Sub
If Cells(SearchRange.Row, 17).Value = "" Then
NewDate = InputBox("Please enter the date", "Date")
Cells(SearchRange.Row, 17).Value = NewDate
Else
msgbox "The Value " & JobNumber & " Already Exists"
End If
Sheets("Complaint Entry").Select
Application.ScreenUpdating = True
Sheets("Do Not Alter").Protect "1", True, True
Sheets("Data Collection").Protect "1", True, True
Sheets("Complaint Entry").Protect "1", True, True
End Sub