Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I have a cell ("G3") that has a list cell validation associated to it. If the user deletes the default value and doesen't select another value, tabs out or clicks elsewhere, the worksheet change event triggers. Because the code relies on a value being in that cell, it errs. Does the fact that I have a cell validation limiting the user to only certain values not prevent the user from proceeding without a value in the cell?
Rich (BB code):
]
If Not mbevents Then Exit Sub
'If not Target.Address = "$G$3" as nothing Then
If Not Intersect(Target, Range("$G$3")) Is Nothing Then
dSDay = Target.Value
dSMonth = Format(Month(DateValue("1 " & Range("E3") & " 2020")), "00")
dSYear = Range("C3").Value
dNDate = DateSerial(dSYear, dSMonth, dSDay) 'dSDay is empty ... it shouldn't have got this far?
mbevents = False
Unprotect
Range("C4") = UCase(Format(dNDate, "DDDD"))
Range("C" & dcomprow) = Format(dNDate, "dd-mmm-yy")
mbevents = True
Protect
End If