Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 19, 11:10 pm, Maruza wrote:
I need to input data only by macro programming. Data sheet must be protected and only macro can unprotect to write data entry. Then macro protects data sheet again to avoid any change. I already try to protect with menu: Tools Protection Protect sheet But macro cannot remember the password. Password is now always blank, which means can be unprotected by anybody. To unprotect the sheet: Sheets("Sheet2").Unprotect Password:="YourPassword" To protect the sheet: Sheets("Sheet2").Protect Password:="YourPassword" To run a check and proceed accordingly: Sub thiser() Dim pw As String pw = "YourPassword" With Sheets("Sheet2") If .ProtectContents = True Then .Unprotect Password:=pw Else .Protect Password:=pw End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to re-protect sheet w/ original password after pasting valuesin new book | Excel Worksheet Functions | |||
Code to protect/unprotect a sheet using a macro with password | Excel Discussion (Misc queries) | |||
How to crack "Protect Sheet" Password in Excel? | Excel Programming | |||
no password carryover with "protect sheet" in macro | Excel Programming | |||
protect sheet macro - can't have it enter password | Excel Programming |