PDA

View Full Version : Need help implementing UserInterFaceOnly:=True



fpt264
02-27-2016, 11:48 AM
I have a workbook with 3 worksheets. I keep my sheets protected but I don't use a password and cells that are used for data entry are unlocked. I am running into a problem with a couple of new macros that won't run because protection is on and I have read about inserting UserInterFaceOnly=True in the workbook module however I have been unable to get it to work.

Please give the exact syntax to go in the workbook module to keep protection on with no password and UserInterfaceOnly set to True. This setting to apply to all sheets in the workbook.

Using excel 2016.


Thank you.

mikerickson
02-27-2016, 12:09 PM
ITs not a setting, it's an argument of the Protect method


Dim oneSheet as Worksheet

For each oneSheet in ThisWorkbook.Worksheets
oneSheet.Protect UserInterfaceOnly:=True
Next oneSheet

fpt264
02-27-2016, 12:16 PM
Thanks again.