Apologies, just realised the code is added into my existing, not as a new code
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Range
Dim myPassword As String
myPassword = "UnknowN"
For Each Cell In ActiveSheet.UsedRange
On Error Resume Next
MyCase = UCase(Cell)
If MyCase = "TARGUS" Or MyCase = "YELLOW" Or MyCase = "RAIL" Or MyCase = "IONS" Or MyCase = "EONS" Or MyCase = "WEBSTORE" Or MyCase = "TV" Or MyCase = "CAPTIAL RENT" Or MyCase = "QUICK" Or MyCase = "LIONS" Or MyCase = "GAME" Or MyCase = "DIRECT" Or MyCase = "NEST" Or MyCase = "HELPER" Or MyCase = "OTTER" Then ' add more if needed
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
ActiveSheet.Protect Password:=myPassword ' Password you have to change what you want
MsgBox "Incorrect Entry" & vbCr & vbCr & "Please use the correct sheet", vbCritical
ThisWorkbook.Close savechanges:=True
End If
Next
If Not Application.Intersect(Target, Range("C:C")) Is Nothing Then
Application.DisplayAlerts = False
ThisWorkbook.Save
Application.DisplayAlerts = True
End If
End Sub
Bookmarks