Worksheet.Protect Method (Excel)

Protects a worksheet so that it cannot be modified.

Syntax

.Protect(Password, DrawingObjects, Contents, Scenarios, UserInterfaceOnly, AllowFormattingCells, AllowFormattingColumns, AllowFormattingRows, AllowInsertingColumns, AllowInsertingRows, AllowInsertingHyperlinks, AllowDeletingColumns, AllowDeletingRows, AllowSorting, AllowFiltering, AllowUsingPivotTables)

A variable that represents a Worksheet object.

Parameters

Name

Required/Optional

Data Type

Description

Password

선택

Variant

A string that specifies a case-sensitive password for the worksheet or workbook. If this argument is omitted, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook. If you forget the password, you cannot unprotect the worksheet or workbook. 대문자와 소문자, 숫자 및 기호로 구성된 강력한 암호를 사용하십시오. 이러한 요소가 혼합되어 있지 않은 암호가 취약한 암호입니다. 예를 들면 강력한 암호는 Y6dh!et5이고 취약한 암호는 House27입니다. 암호 길이는 8자 이상이어야 하고, 14자 이상의 암호라면 더 좋습니다. 자세한 내용은 Help protect your personal information with strong passwords를 참조하십시오. 암호를 기억해 두는 것은 매우 중요합니다. 암호를 잊은 경우 Microsoft에서 해당 암호를 검색할 수 없습니다. 암호는 기록해서 해당 정보와 상관없는 안전한 장소에 보관해야 정보를 더욱 안전하게 보호할 수 있습니다.

DrawingObjects

선택

Variant

True to protect shapes. The default value is True.

Contents

선택

Variant

True to protect contents. For a chart, this protects the entire chart. For a worksheet, this protects the locked cells. The default value is True.

Scenarios

선택

Variant

True to protect scenarios. This argument is valid only for worksheets. The default value is True.

UserInterfaceOnly

선택

Variant

True to protect the user interface, but not macros. If this argument is omitted, protection applies both to macros and to the user interface.

AllowFormattingCells

선택

Variant

True allows the user to format any cell on a protected worksheet. The default value is False.

AllowFormattingColumns

선택

Variant

True allows the user to format any column on a protected worksheet. The default value is False.

AllowFormattingRows

선택

Variant

True allows the user to format any row on a protected. The default value is False.

AllowInsertingColumns

선택

Variant

True allows the user to insert columns on the protected worksheet. The default value is False.

AllowInsertingRows

선택

Variant

True allows the user to insert rows on the protected worksheet. The default value is False.

AllowInsertingHyperlinks

선택

Variant

True allows the user to insert hyperlinks on the worksheet. The default value is False.

AllowDeletingColumns

선택

Variant

True allows the user to delete columns on the protected worksheet, where every cell in the column to be deleted is unlocked. The default value is False.

AllowDeletingRows

선택

Variant

True allows the user to delete rows on the protected worksheet, where every cell in the row to be deleted is unlocked. The default value is False.

AllowSorting

선택

Variant

True allows the user to sort on the protected worksheet. Every cell in the sort range must be unlocked or unprotected. The default value is False.

AllowFiltering

선택

Variant

True allows the user to set filters on the protected worksheet. Users can change filter criteria but can not enable or disable an auto filter. Users can set filters on an existing auto filter. The default value is False.

AllowUsingPivotTables

선택

Variant

True allows the user to use pivot table reports on the protected worksheet. The default value is False.

Remarks

If changes wanted to be made to a protected worksheet, it is possible to use the Protect method on a protected worksheet if the password is supplied. Also, another method would be to unprotect the worksheet, make the necessary changes, and then protect the worksheet again.

참고

'Unprotected' means the cell may be locked (Format Cells dialog box) but is included in a range defined in the Allow Users to Edit Ranges dialog box, and the user has unprotected the range with a password or been validated via NT permissions.

참고 항목

개념

Worksheet Object

Worksheet Object Members