formating locked sheets

minnymoony

New Member
Joined
Jan 24, 2011
Messages
8
Hi,
I have an excel sheet "sheet1", that has a button witch creates a table on "sheet2". I want to lock the whole file. I also want to put a button on sheet1 to clear sheet2.
Is it possible to lock the file and still create and erase data on a sheet?

Thanks in advance.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Try protecting it this way so that it will be protected except for your code.

Example.
Code:
[/FONT]
[FONT=Courier New]Sub Protect()[/FONT]
[FONT=Courier New]Sheets("Sheet1").Protect Password:="mypass", userinterfaceonly:=True[/FONT]
[FONT=Courier New]Sheets("Sheet2").Protect Password:="mypass", userinterfaceonly:=True[/FONT]
[FONT=Courier New]End Sub

After running this. trying changing anything manually, it will not allow it....trying running your macro it will run without having you to unprotect & protect again
 
Last edited:
Upvote 0
Thanks for the reply,

But I don't quite understand how/where I can implement those lines in my code. Do I create a command button ?

Thanks
 
Upvote 0
Hi,
I think I managed to understand how to use the code given by "pedie" and so far it works great, Thanks.
Now I have another question.
I have a sheet (sheet1, for example) and I want to put a command-button on sheet1 to create a table (table1, for example) on sheet1. The thing is I want to Lock the sheet and leave part of the cells unlocked and the rest of the cells locked. Also I want to be able to clear the table and its contents, using another command-button.

Thanks in advance
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top