I'm setting up a excel worksheet. In this sheet, the user can only interact with cells in a certain range, eg. ("A1:B10"). So I set those cells to be "unlocked" cells, and password protect the entire sheet, with the option to only allow the user to "select unlocked cells".
One thing I'm facing is, while the worksheet is password protected, it needs to have the ability to allow the user paste data from external sources. How can I enable the paste function while the worksheet remains password protected?
UPDATE:
This is in a macro-enabled workbook.
I used the following code to enable and disable some functions in the workbook.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.Calculation = xlAutomatic
End Sub
Private Sub Workbook_Open()
Application.Calculation = xlAutomatic
Application.CellDragAndDrop = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.Calculation = xlAutomatic
Application.CellDragAndDrop = True
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
Application.Calculation = xlAutomatic
End Sub
I found that, when I take the code out, save and re-open the workbook, pasting is working OK. Once I paste the code in, save and re-open the workbook, pasting doesn't work.