Require date format - Tried to combine some code but can't get to work

Status
Not open for further replies.

Caveman1964

Board Regular
Joined
Dec 14, 2017
Messages
127
Office Version
  1. 2016
Platform
  1. 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
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I may need to give better explanation.
code is supposed to look in "data collection" range A:A, if it finds it, then it goes across to column 17, if a date already exists, it tells user that and exits. If it doesn't exists, it requires a date format. And puts it in column 17 of the job number found.
I am still working on it myself with no luck.
 
Last edited:
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,224,816
Messages
6,181,139
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top