vba excel

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Vba excel

Vba excel

resolvedResolved · 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?

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.

 

Training courses

 

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Seeing named ranges as part of the zoom

If you have large areas of named ranges this works better.

If you zoom down to 39% you will see your named range.

View all Excel hints and tips


Server loaded in 0.1 secs.