joms
07-08-2013, 01:16 AM
hi guys,
I had protected some cells using VBA with this code below, it does protect the cells.
But when I click on the "Review" tab, and click on "Unprotect Sheet" it didn't prompt for a password.
Is there a way to do it, that when cells is protected via VBA and when the user click on the "Review" Tab to Unprotect the Sheet, a password confirmation will be prompted.
Any ideas is greatly appreciated.
Thanks in advance :)
ThisWorkbook.Worksheets("Sheet1").Cells.Locked = True
'Lock the cells
ThisWorkbook.Worksheets("Sheet1").Range("B1:B5535").Locked = True
ThisWorkbook.Worksheets("Sheet1").Protect Password:="123xxx"
I had protected some cells using VBA with this code below, it does protect the cells.
But when I click on the "Review" tab, and click on "Unprotect Sheet" it didn't prompt for a password.
Is there a way to do it, that when cells is protected via VBA and when the user click on the "Review" Tab to Unprotect the Sheet, a password confirmation will be prompted.
Any ideas is greatly appreciated.
Thanks in advance :)
ThisWorkbook.Worksheets("Sheet1").Cells.Locked = True
'Lock the cells
ThisWorkbook.Worksheets("Sheet1").Range("B1:B5535").Locked = True
ThisWorkbook.Worksheets("Sheet1").Protect Password:="123xxx"