Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Sheets("Sheet1").Range("B3").Value >= -Date And Sheets("Sheet1").Range(" B3").Value <= Date - 1 Then
ActiveWorkbook.Unprotect Password:="password"
MsgBox "This workbook is locked, please contact xxx@xxx.com"
Else
'MsgBox "unlocked"
End If
End Sub
Currently the code is working in Sheet1 only. How do I enter it in a module so that it applies to all new sheets added on the workbook?