Not looking for Password Protection or event .Is there any method like public sub Protect()
under this we can do it .Not in event .
What I have tried:
Public Sub Worksheet_SelectionChange()
Dim xRg As Range
Dim xr As Range
Dim xRgEx As Range
Dim xRgExEach As Range
On Error Resume Next
Application.ScreenUpdating = False
Set xr = Sheets("Sheet1").Range("A:N,1:15")
Set xRg = Sheets("Sheet1").Range("M:Z,15:30") 'Change the row range and column range you will lock without protecting worksheet
Set xRgEx = Application.Intersect(xr, xRg)
If xRgEx Is Nothing Then Exit Sub
Cells(1, 1).Select 'Specify a cell you will shift to after selecting the locked cells
Application.ScreenUpdating = False
End Sub
but My excel range is L18 to AI 50