Sheet Protection

sturnusek

Board Regular
Joined
Sep 20, 2018
Messages
51
Hi there,

I'm trying to put a code into my macro, but I struggle with finding right arguments for the code.

I'm want cells from A:F to be locked and be unselectable, and range from H:Q to be locked and selectable.

Any ideas?

Thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi there,

I'm trying to put a code into my macro, but I struggle with finding right arguments for the code.

I'm want cells from A:F to be locked and be unselectable, and range from H:Q to be locked and selectable.

Any ideas?

Thanks

Select the cells you don't want to be locked, right click on them -> format cells -> protection untick Locked
make sure that the ones you do want protected have Locked ticked

when you protect the worksheet, the ones that are unticked will not be protected?
 
Last edited:
Upvote 0
Select the cells you don't want to be locked, right click on them -> format cells -> protection untick Locked
make sure that the ones you do want protected have Locked ticked

when you protect the worksheet, the ones that are unticked will not be protected?

The problem is, I want my entire workbook to be protected. With the difference, that I want cells from A:F to be locked & cells to be unselectable, and cells from H:Q to be locked & selectable. As per default Workbook protection once you set a password and apply settings to the locked cells, I can only achieve half of what I want to do. I want all of this to happen within a macro, as it's going to be a part of something else that its already in place.

Thanks
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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