Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' ----------------------------------------------------------------
- ' Purpose: Check if selection is restricted on a sheet in any way
- ' ----------------------------------------------------------------
- Function f_allSelectionEnabled(sh As Worksheet) As Boolean
- 'If the sheet is not protected OR sheet is protected but EnableSelection is xlNoRestrictions returns True, otherwise False
- If sh.ProtectContents = False Or (sh.ProtectContents = True And sh.EnableSelection = xlNoRestrictions) Then
- f_allSelectionEnabled = True
- Else
- f_allSelectionEnabled = False
- End If
- End Function
Advertisement