Hi,
I would like to allow users to selcet all sheets in a Excel workbook in which all the sheets are protected.Allow them to
1. copy all the sheets and paste only the values without the formulas.
2. when they click inside the sheet then the workbook is protected again.
The second part work fine with me.But when I try to select all the sheets and unprotect the shets the sheets are ungrouped and the active sheet values are copied and pasted.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Address = Cells.Address Then
ActiveSheet.Unprotect PWD
ElseIf ActiveSheet.ProtectContents = False Then
Call LockCells
Call UnlockCells
End If
End Sub
Private Sub Worksheet_BeforeRightClick(ByVal Target As Excel.Range, Cancel As Boolean)
Unprotect_All_Sheets
End Sub
ASKER
where exactly should I place the code.