issue with protected sheets

vilas desai
3StarLounger
Posts: 307
Joined: 16 Mar 2011, 09:33

issue with protected sheets

Post by vilas desai »

Dear Sirs,

1. In a worksheet, I protect certain cols for editing. But these cols should accept values by formula or by copy or any method mentioned in the code (Module / worksheet)
How can I achieve this?
2. When I protect a certain col in one worksheet, the same col gets protected in another worksheet too. How can I prevent this?

Thanks and best regards
Vilas Desai

User avatar
Rudi
gamma jay
Posts: 25455
Joined: 17 Mar 2010, 17:33
Location: Cape Town

Re: issue with protected sheets

Post by Rudi »

Hi,

By default, formulas will update in a protected area of a sheet.
In order to apply actions in a protected area of a sheet, or have macros change data in that protected area, you need to unprotect the area, do the actions and then re-protect the area. This needs to be scripted into the macros if they are running...

Code: Select all

Sub UpdateProtected()
ActiveSheet.Unprotect 'Password:="pass"
Range("A1").Copy
Range("B1").PasteSpecial 'Paste into the protected location
ActiveSheet.Protect 'Password:="pass"
End Sub
Regarding question #2
AFAIK, this is not possible. Excel disallows protecting multiple worksheets at the same time? Do you have a macro that runs a loop and protects many sheets with the same password?
Regards,
Rudi

If your absence does not affect them, your presence didn't matter.