I have this code with me
It does not return any error but its not letting me choose anything from the list.![]()
Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False 'Does the validation range still have validation? If HasValidation(Range("E2:F32")) Then Exit Sub Else Application.Undo MsgBox "Your last operation was canceled." & _ "It would have deleted data validation rules.", vbCritical End If Application.EnableEvents = True End Sub Private Function HasValidation(r) As Boolean ' Returns True if every cell in Range r uses Data Validation On Error Resume Next x = r.Validation.Type If Err.Number = 0 Then HasValidation = True Else HasValidation = False End Function
But it does stop deleting any value and stop pasting any value to the cell.
Can you have a look at this please
Otherwise Can I get a code where I can restrict entries on SAT , SUN and Holiday. User should choose it from the list and no copy ,paste allowed on those cell.
Bookmarks