In my workbook I want to prevent selection of multiple
sheets (by others), so that any changes will only affect
the active sheet.
I have tried to find a property to set or an event to
respond to; no luck.
Anyone any suggestions?
Thanks.
Try putting the code below into the ThisWorkbook object of your project.
HTH,
Bernie
Dim myFlag As Boolean
Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Range)
Application.EnableEvents = False
If ActiveWorkbook.Windows(1).SelectedSheets.Count > 1 Then
Sh.Select
If myFlag = False Then
MsgBox "You have multiple sheets selected. Bad user."
Application.Undo
myFlag = True
End If
End If
Application.EnableEvents = True
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, _
ByVal Target As Range)
myFlag = False
End Sub