Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Vba excel
Vba excel
Resolved · Low Priority · Version 2007
Jon has attended:
Excel Intermediate course
Excel Intermediate course
Excel Advanced course
Excel Advanced course
Excel VBA Intro Intermediate course
Vba excel
can I make a piece of code unlock, write to and the relock cells?
For upcoming training course dates see: Pricing & availability
RE: vba excel
Hello Jon,
Depending on the context of what you are hoping to achieve, you can lock the cells you don't want touched through the Format Cells, Protection. Then apply the worksheet protection.
Or have the code just turn on a protected sheet, then when you need to write to a cell or cells, turn off the protection temporarily, write to cells, then turn protection on again.
Code required to protect:
sheets("Name of sheet").protect Passord:= "password here"
to unprotect:
sheets("name of sheet").unprotect Password:="password"
I hope this resolves your question. If it has, please mark this question as resolved.
If you require further assistance, please reply to this post. Or perhaps you have another Microsoft Office question?
Have a great day.
Regards,
Mark
Microsoft Office Specialist Trainer
Tue 13 Dec 2011: Automatically marked as resolved.
|
