excel worksheet protection questions

jpmckitrick

New Member
Joined
Mar 19, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have a couple of worksheets that have columns with formulas and columns that are manual input data. I want to protect the formulas and allow users to input data in the other cells. I also need them to be able to select the formula cells, plus filter and sort the data. I thought I had it all figured out then found another issue. I first unlocked the entire sheet. Then I used Find & Select to select all the cells with formulas. I set all those to locked. I then read on a forum about using data validation to set it where the locked formula cells could be selected but not changed. I thought that had worked. If anyone tries to type in the cell, an error message pops up that says the cell contains a formula and cannot be edited. BUT, I think discovered I could copy and paste data into that cell. Any idea or suggestions on what I can do differently?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
The following will allow Column A to be selected but not changed :

VBA Code:
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
    Worksheets("Sheet1").Cells.Locked = False
    Worksheets("Sheet1").Range("A1:A20").Locked = True
    Worksheets("Sheet1").Protect Password:="pass", UserInterfaceOnly:=True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,854
Messages
6,121,941
Members
449,056
Latest member
denissimo

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