Try this modified version
I added WS_Activate and changed the OnTime call
Option Explicit
Const iWait As Long = 10 'testing
Private Sub Worksheet_Activate()
bInCountDown = False
With Me
.Unprotect Password:=g_strPASS
.Columns(10).Locked = False
.Columns(13).Locked = True
.Cells(1, 10).Locked = True
.Protect Password:=g_strPASS
End With
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng As Range
Dim rngM As Range
Dim rngScope As Range
Dim boolUnlock As Boolean
Set rngScope = Intersect(Target, Me.Columns(10))
If rngScope Is Nothing Then Exit Sub
If bInCountDown Then Exit Sub
Me.Unprotect Password:=g_strPASS
Set rng = rngScope.Offset(0, 3)
rng.Locked = False
Me.Protect Password:=g_strPASS
Application.StatusBar = "Now Unlocking column M for " & iWait & " seconds"
bInCountDown = True
Application.OnTime Now + TimeSerial(0, 0, iWait), "'LockRange """ & Me.Name & "!" & rngScope.Offset(0, 3).Address & """'"
End Sub
Option Explicit
Public Const g_strPASS As String = "aaa"
Public bInCountDown As Boolean
Sub LockRange(strAddress As String)
Application.StatusBar = "Now Relocking " & strAddress
Application.EnableEvents = False
With Application.Range(strAddress)
.Parent.Unprotect Password:=g_strPASS
.Locked = True
.Parent.Protect Password:=g_strPASS
End With
Application.EnableEvents = True
bInCountDown = False
Application.StatusBar = False
End Sub