Try using
Worksheet.Protect "Password", UserInterfaceOnly := True
If the UserInterfaceOnly parameter is set to true, VBA code can modify protected cells.
More Related Contents:
- to make this code simpler
- VBA – How to grab the cell below if a cell has text?
- VBA code takes long time to execute in excel
- Find text and show value if condition is met
- How can I insert variable into formula in VBA
- Excel VBA deleting rows in a for loop misses rows
- VBA – destroy a modeless UserForm instance properly
- What is the lifetime of a global variable in excel vba?
- Copy data from another Workbook through VBA
- Excel VBA Load worksheet in Function
- Searching an excel with two search words (multiple lookup) using vba macro [closed]
- Saving a Excel File into .txt format without quotes
- Excel VBA – Combine rows with duplicate values in one cell and merge values in other cell
- Load csv file into a VBA array rather than Excel Sheet
- Insert line break in wrapped cell via code
- Change color of certain characters in a cell
- Fastest way to delete rows which cannot be grabbed with SpecialCells
- Combine multiple Excel workbooks into a single workbook
- Excel Macro, inserting internationally valid formula during run-time
- VBScript – How to make program wait until process has finished?
- Want VBA in excel to read very large CSV and create output file of a small subset of the CSV
- Copy filtered data to another sheet using VBA
- Range.Find on a Date That is a Formula
- VBA Macro crashes after 32000 rows
- Range() vs Cells() vs Range.Cells()
- How to create dynamic variable names VBA
- How to break a long string into multiple lines
- Read VBA macros (or vbaProject.bin) of an Excel file without opening it in MS Excel [closed]
- simple vba code gives me run time error 91 object variable or with block not set
- VBA inheritance, analog of super