How do I protect cells once data input.

ghrek

Active Member
Joined
Jul 29, 2005
Messages
426
Hi I have posted on here but dont understand. How do I lock cells once data input [SOLVED]

What it is I have a workbook that already has protected cells but what im trying to do is when data is input into UNPROTECTED cells I need them protected too.

When I clear on clear cells macro I need the ones that were protected to be unprotected and cleared.

All the cells that are unprotected and need protecting when data input are in bold borders.

Any Ideas? Link to workbook below...

 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hope this helps as some examples how to unlock and lock sheets w/ password protection in VBA:

VBA Code:
'Unlock all sheets in workbook
    Dim i As Long
    
    For i = 1 To Sheets.Count
        Sheets(i).Unprotect Password = "Password"
    Next i


'Locks Certain Cells or Ranges

Worksheets("Summary").Range("F7").Locked = False    'use before if there's cells you don't want locked, otherwise skip

Sheets("Summary").Protect Password = "Password"   'lock using password in macro
 
Upvote 0
@Oddball2020
In what way has that got anything to do with the OP's request?
He's talking about locking/unlocking cells on the sheet... I assumed he would be using VBA as a solution. I know I didn't solve it for him, but was just providing some VBA that he could use along those lines if he wanted. If it's not an appropriate post, please delete it, thanks!
 
Upvote 0

Forum statistics

Threads
1,214,870
Messages
6,122,021
Members
449,060
Latest member
LinusJE

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