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?
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 firstname.lastname@example.org" Else 'MsgBox "unlocked" End If End Sub
This question generated 20 answers. To proceed to the answers, click here.
This thread is current as of July 25, 2014.