vba excel
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Vba excel

resolvedResolved · Low Priority · Version 2007

replyReply Tue 6 Dec 2011, 16:10Delegate Jon said...

Vba excel

can I make a piece of code unlock, write to and the relock cells?

For upcoming training course dates see: Pricing & availability

replyReply Wed 7 Dec 2011, 09:27Trainer Mark said...

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.

 

Please browse our web site to find out more about
best training excel vba and other Microsoft training courses.

Excel tip:

Saving your Excel Spreadsheet as a CSV File

In situations where you need to save your Excel spreadsheet as a CSV file, follow these simple steps.

Click the File tab and click Save As.
Enter a name in the File name field.
Click the drop-down arrow next to the Save as type field to select the file type. Scroll down the list and select CSV (comma delimited) (*.CSV)
Click Save

The data will now be saved to a separate CSV file which can be used in different applications.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard