Hello Guys,
I am using this code to filter out one of the drop down list based on cell entry and I have to protect the sheet post which this code doesnt seem to work, please help.
I tried unprotect and protect password in the code but that doesn't seems to work. Rest all other sheets with other codes are working fine.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim str1 As String
If Target.Address(0, 0) = "K10" Then
Range("B5").ClearContents
On Error Resume Next
Range("B5").Validation.Delete
On Error GoTo 0
str1 = LCase(Target.Value)
If InStr(1, str1, "@gmail.com") Then
Range("B5").Validation.Add Type:=xlValidateList, Formula1:="=vld_gmail"
ElseIf InStr(1, str1, "hotmail.com") Then
Range("B5").Validation.Add Type:=xlValidateList, Formula1:="=vld_hotmail"
Else
Range("B5").Validation.Add Type:=xlValidateList, Formula1:="=vld_all"
End If
End If
End Sub
Please help
Bookmarks