Forum Discussion
INeedHelpSoon
Jul 26, 2022Copper Contributor
Protect WorkSheet but change cell values via VB without password dialogue
I have a worksheet with macro control. Other than control, the whole sheet is "locked" and password protected. When clicking on the control, I want to change some values in the worksheet (via VB code...
JKPieterse
Jul 26, 2022Silver Contributor
You can't have VBA code unprotect a sheet without the PW dialog and at the same time without including the password. But you can protect the VBA project so others cannot see the password. Would that help?
INeedHelpSoon
Jul 28, 2022Copper Contributor
Yes that would help... suggestion?
- JKPieterseJul 28, 2022Silver Contributor
INeedHelpSoon Sure, something like:
Sub ChangeSomething() ActiveSheet.Unprotect "PasswordGoesHere" Range("C3").Value = "Entry Into cell C3" ActiveSheet.Protect "PasswordGoesHere" End Sub