VBA to protect cell in excel
Closed
hemu
-
Nov 3, 2015 at 04:43 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Nov 3, 2015 at 11:10 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Nov 3, 2015 at 11:10 AM
Related:
- VBA to protect cell in excel
- Number to words in excel formula without vba - Guide
- Vba case like - Guide
- How to open vba in excel mac - Guide
- How to take screenshot in excel - Guide
- Gif in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
December 27, 2022
555
Nov 3, 2015 at 11:10 AM
Nov 3, 2015 at 11:10 AM
Hi Hemu,
Since you are new to VBA, you should get familiar with the macro recorder.
Start by unblocking all cells except the one cell. The option can be found under the Protection tab of Cell Properties.
Then record a macro > protect and unprotect sheet with password.
Check to see how that looks like.
Use that recorded code together with a logic like:
If range(your cell) = "Yes" then
use the protect sheet part
elseif range(your cell) = "No" then
use the unprotect sheet part
end if
Let us know how it goes.
Best regards,
Trowa
Since you are new to VBA, you should get familiar with the macro recorder.
Start by unblocking all cells except the one cell. The option can be found under the Protection tab of Cell Properties.
Then record a macro > protect and unprotect sheet with password.
Check to see how that looks like.
Use that recorded code together with a logic like:
If range(your cell) = "Yes" then
use the protect sheet part
elseif range(your cell) = "No" then
use the unprotect sheet part
end if
Let us know how it goes.
Best regards,
Trowa