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
 
Ha spoke too soon - That worked for allowing row formatting post macro run, but now allows locked cells to be accessed. Thanks though, I'll keep working it !
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Try adding
VBA Code:
    ActiveSheet.EnableSelection = xlUnlockedCells
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
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