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

vba excel

ResolvedVersion 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:

Brighten up your Excel 2010 Spreadsheet by changing the colours of the gridlines

Excel 2010 allows you to change the colour of grid lines instead of keeping them in boring black.

Select the File tab on the Ribbon, click Options, click Advanced, scroll down to ''Display options for this worksheet.'' Next to ''Gridline colour,'' choose your favourite colour, then once you've done this, click OK. Easy!

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.