Restrict Editing

nuage

New Member
Joined
Aug 29, 2018
Messages
5
How to restrict editing in filled cell? i.e. lock cell in which entry already made.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
welcome to the forum nuage

Remember to unlock the cells that user is allowed to edit beforehand
(select range \ right-click \ Format Cells \ Protection \ unckeck Locked)

Place code in sheet module
(right-click sheet tab \ View Code \ paste into code window)
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Me.Unprotect "password"
    Target.Locked = True
    Me.Protect "password"
End Sub

Above code locks each cell after edit

Do you want this to apply to specific cells, columns etc?
- let us know
 
Last edited:
Upvote 0
Worksheets have cells, Userforms do not

What do you want?
1. prevent further change to a value in the UserForm?

2. lock a cell in the worksheet after that cell is amended by UserForm?

3. something else (please explain)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,395
Members
449,081
Latest member
JAMES KECULAH

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