lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I wrote the code below then inserted Control Button in my sheet to run the code. When I clicked on the button first time, it did work, right clicked on the sheet and everything was grayed out, can not copy, rename, move etc. so far so good but then when I clicked on the button again to run the code again, I was so surprised to find out everything was unlocked! I can copy, rename, etc. Why is that? if that is the case why we have Workbooks(1).unprotect, thank you
Sub test2()
Workbooks(1).Protect
End Sub
I wrote the code below then inserted Control Button in my sheet to run the code. When I clicked on the button first time, it did work, right clicked on the sheet and everything was grayed out, can not copy, rename, move etc. so far so good but then when I clicked on the button again to run the code again, I was so surprised to find out everything was unlocked! I can copy, rename, etc. Why is that? if that is the case why we have Workbooks(1).unprotect, thank you
Sub test2()
Workbooks(1).Protect
End Sub