Skip to main content

How to make cell as read only in Excel?

Author: Siluvia Last Modified: 2024-08-26

In many cases, you may need to prevent others from editing some specified cells in your worksheet. This article provides two methods to help you make specified cells as read only, so that others cannot edit these cells except for reading.

Make cell as read only by protecting worksheet
Make cell as read only by VBA code without protecting worksheet


Make cell as read only by protecting worksheet

You can only lock the cells which you want to make them read-only, and then protect this worksheet to achieve it. Please do as follows.

1. Click the a screenshot of the select all cells icon button on the top left corner of current worksheet to select the whole cells.

a screenshot of selecting all cells in the current worksheet

2. Press the Ctrl + 1 keys simultaneously to open the Format Cells dialog box. In the dialog box, uncheck the Locked box under the Protection tab, and then click the OK button. See screenshot:

a screenshot of uncheck the Locked option in the Format Cells dialog box

3. Now select the cells you want to make them as read only (here I select cells of range A1:C18). Press the Ctrl + 1 keys simultaneously to open the Format Cells dialog box, check the Locked box under the Protection tab and click the OK button.

a screenshot of locking the cells to be set as read-only

4. Go ahead to click Review > Protect Sheet. See screenshot:

a screenshot of enabling the Protect Sheet feature

5. Specify and confirm your password to protect the worksheet as below screenshot shown.

a screenshot of specifying password

Now cells in the locked range are read-only now. When you try to edit these specific cells inside the range, you will get a prompt box as below screenshot shown.

a screenshot showing cell protected alert box


Protect multiple/all worksheets with password at the same time in current workbook:

Microsoft Excel allows you to protect one worksheet with password at a time. Here you can use the Protect Worksheet and Unprotect Worksheet utilities of Kutools for Excel to quickly protect or unprotect multiple worksheets or all workrksheets in current workbook with password at the same time.
Download and try it now! (30-day free trail)

a screenshot showing how to use Kutools for Excel to easily protect multiple worksheets at the same time


Make cell as read only by VBA code without protecting worksheet

If you don’t want to protect the worksheet to make cell as read only. The VBA script in this section will help you to solve this problem easily.

1. Right click the sheet tab you need to make cell as read only, and then click View Code from the right-clicking menu.

2. In the opening Microsoft Visual Basic for Applications window, copy and paste the below VBA code into the Code window.

VBA code: Make cell as read only in Excel

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Target.Column = 1 Then
        If Target.Row = 3 Or Target.Row = 4 Or Target.Row = 5 Then
            Beep
            Cells(Target.Row, Target.Column).Offset(0, 1).Select
            MsgBox Cells(Target.Row, Target.Column).Address & " cannot be selected and edited as it is a read-only cell", _
            vbInformation, "Kutools for Excel"
        End If
    End If
End Sub

Note: This code can just make specified cells in one column as read only. In this code, it will make cell A3, A4 and A5 as read only in current worksheet.

a screenshot showing how to use the VBA code

3. Press the Alt + Q keys to close the Microsoft Visual Basic for Applications window.

When clicking on cell A3, A4 or A5 in current worksheet, you will get a Kutools for Excel dialog box as below screenshot shown, and the cursor will move to the right adjacent cell automatically.

a screenshot of the alert box showing cells as read-only


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!