EnableSelection Property
The document is archived and information here might be outdated

Worksheet.EnableSelection Property

Office 2007
Returns or sets what can be selected on the sheet. Read/write XlEnableSelection.



expression   A variable that represents a Worksheet object.


This property takes effect only when the worksheet is protected: xlNoSelection prevents any selection on the sheet, xlUnlockedCells allows only those cells whose Locked property is False to be selected, and xlNoRestrictions allows any cell to be selected.


This example sets worksheet one so that nothing on it can be selected.

Visual Basic for Applications
With Worksheets(1)
    .EnableSelection = xlNoSelection
    .Protect Contents:=True, UserInterfaceOnly:=True
End With

© 2016 Microsoft