Running Macro disables a certain "allow users" function on a protected sheet

dvine2us

New Member
Joined
Mar 8, 2022
Messages
7
Office Version
  1. 365
I have an excel spreadsheet that is protected but allows users to select unlocked cells and format rows (so they can adjust height). I also have a macro to spell check the sheet. When the macro button is selected by the user to spell check their entries, the spell check works fine, but then the "allow user to format rows" goes away and the user can no longer adjust row height

1646757379747.png


This is the macro code I have to allow spell check on protected sheet

Sub ProtectSheetCheckSpellCheck()
'Update by Extendoffice 2018/11/2
Dim xRg As Range
On Error Resume Next
Application.ScreenUpdating = False
With ActiveSheet
.Unprotect ("dcs")
Set xRg = .UsedRange
xRg.CheckSpelling
.Protect ("dcs")
End With
Application.ScreenUpdating = False
End Sub


Help needed - Thanks in advance
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Try changing this line:
.Protect ("dcs") to

.Protect ("dcs") AllowFormattingCells:=True
.EnableSelection = xlNoRestrictions
 
Upvote 0
Thanks - My company uses this Excel sheet to generate a form and users have a habit of jacking it all up because the sheet is not locked down. So I trying to fix that and I am no excel guro, but have more experience then whoever created this sheet in the first place. But Excel takes away auto row height adjustment and the user spell check option when protected Really sucks that those 2 options are lost simply because I want to protect the sheet
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,215
Members
453,024
Latest member
Wingit77

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