Protecting Sheet to not allow cell selection

vbaNumpty

Board Regular
Joined
Apr 20, 2021
Messages
171
Office Version
  1. 365
Platform
  1. Windows
I use the following macro in two workbooks:

VBA Code:
Sub Protect_DB()

    Application.ScreenUpdating = False
    
    Sheet1.Protect Password:="password", DrawingObjects:=True, Contents:=True, Scenarios:=True _
        , AllowFormattingCells:=True

End Sub

However in the first workbook where I initially created that macro it does not allow a user to select any cells no singular cell is highlighted with the square to show you what cell you have selected.

In the second workbook, everything is locked similarly, but I am able to move through 4 cells with the arrow keys and enter values in the ranges w1, x1, w2 and W5001 for some unknown reason.

I cannot figure out why this is happening.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Forum statistics

Threads
1,215,854
Messages
6,127,345
Members
449,379
Latest member
phyxius117

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
Back
Top