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 January 16, 2023 - Nov 3, 2015 at 11:10 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen January 16, 2023 - Nov 3, 2015 at 11:10 AM
Related:
- VBA to protect cell in excel
- Number to words in excel without vba - Guide
- How to enable vba in excel - Guide
- Excel date format dd.mm.yyyy - Guide
- Vba case like - Guide
- Vba code to search data in excel - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 16, 2023
549
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