Hi, can you please help me with this code.
The code works fine on all cells of the active sheet.
I need the code to only take effect if anything was typed in the cells between C4:C30 only.
Thank you so much in advance!
Leny
The code works fine on all cells of the active sheet.
I need the code to only take effect if anything was typed in the cells between C4:C30 only.
Thank you so much in advance!
Leny
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Rspn = MsgBox("You have changed " & Target.Address & ". This cell will be locked for further editing. Do you wish to proceed?", vbYesNo)
Select Case Rspn
Case Is = vbNo
Application.EnableEvents = False
Application.Undo
Application.EnableEvents = True
Case Is = vbYes
ActiveSheet.Unprotect "PC123"
Target.Locked = True
ActiveSheet.Protect "PC123"
End Select
End Sub