cell locking and protection

Joe from Melton

New Member
Joined
Aug 12, 2017
Messages
1
I have created a spreadsheet that has some formulas in it that I need to protect from other users overwriting or deleting in error. I can lock and protect the relevant cells, leaving the other cells unlocked, but when I copy and paste data into it from another spreadsheet they get protected automatically due to the cells being locked by default. Its not much of a problem for myself, but when others are to use it trying to get them to unlock the cells before copying them or pasting values only complicates things for them.
Does anyone have any solutions where I can protect all the cells i need to without using the protect function?
Im using office 2010

Thanks
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Joe from Melton;4888383I can lock and protect the relevant cells said:
due to the cells being locked by default[/B].
If you run this macro, it will lock all cells containing a formula and unlock all the other cells...
Code:
Sub LockFormulasUnlockEverythingElse()
  Cells.Locked = False
  On Error Resume Next
  Cells.SpecialCells(xlFormulas).Locked = True
  On Error GoTo 0
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,244
Members
452,622
Latest member
Laura_PinksBTHFT

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