Locking/Unlock Specific Cell

HWL

Active Member
Joined
Dec 1, 2009
Messages
462
From all accounts, the following code should work:

ThisWorkbook.Sheets(1).Range("b13").Locked = False

To set the locked property of B13 on sheet(1) to False (unlocked)
Neither the workbook or worksheet is currently protected, so that's not the problem yet I get this compiling error:

Run-time Error '1004'
Unable to set the Locked property of range class
What am I missing?

SOLVED:
Well, that was easy enough, the cell I was trying to modified is merged with C13 and D13, so you have to select the entire range to change. Works fine now.
 
Last edited:

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Watch MrExcel Video

Forum statistics

Threads
1,127,086
Messages
5,622,614
Members
415,913
Latest member
1000rr

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
Top