We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Public Function LockIt(ByVal nlValue As Integer, ByVal rangeIN As String) As Boolean On Error GoTo ErrHandler: Dim lLock As Boolean Dim lSuccess As Boolean If nlValue = 1 Then lLock = False Else lLock = True End If Sheet1.range(rangeIN).Locked = lLock Debug.Print Sheet1.range(rangeIN).Locked LockIt = lLock ErrCleanup: LockIt = lSuccess Exit Function ErrHandler: lSuccess = False MsgBox Err.Description, vbExclamation + vbOKOnly, "Error Encountered" Resume ErrCleanup End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.