You can use the Visual Basic
EnableSelection property to determine what, if any, cells on a worksheet may be selected by the user. EnableSelection has three possible constants:
Constant Definition
---------------------------------------------------------------------
xlNoRestrictions Any cell can be selected.
xlNoSelection No cells can be selected.
xlUnlockedCells If the worksheet is protected, only cells that are
unlocked can be selected.
You can unlock a cell or group of cells by using the following steps:
- Select the cell(s) to be unlocked.
- On the Format menu, click Cells.
- On the Protection tab, click to clear the Locked check box, and then click OK.
If the worksheet is protected and you have set the
EnableSelection property to xlUnlockedCells, you cannot select locked cells, either by clicking them with the mouse or by using the
Go To dialog box on the
Edit menu. However, you can select locked cells by using the
Name box on the Excel formula bar.
If you click the
Name box, type in a cell reference (D5, for example) or a range reference (D5:E10, for example), and then press ENTER, the indicated cell or range will be selected.
NOTE: Because the cells are locked and the worksheet protected, locked cells cannot be changed. You can, however, copy or fill from a locked cell into unlocked cells.