PW Protected Spellcheck & Format Rows Issue

r0bism123

Board Regular
Joined
Feb 8, 2018
Messages
57
Hi gang,

I am having an issue I'm hoping someone can help me out with. I need to run the spellcheck code below, however, I also need the "Format Rows" boxed check before the code completes the task (see screen shot below). I'm sure there is an easy fix -- I cant seem to figure it out. Your help is appreciated in advance!

Code:
Sub SpellCheckCell1()
    Application.ScreenUpdating = False
On Error Resume Next
    With ActiveSheet
        .Unprotect ("pw123")
        Selection.CheckSpelling
        .Protect ("pw123")
    End With
    Application.ScreenUpdating = True
End Sub

Pic.jpg
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
r0bism123, try....

Code:
Sub SpellCheckCell1()    Application.ScreenUpdating = False
On Error Resume Next
    With ActiveSheet
        .Unprotect ("pw123")
        Selection.CheckSpelling
        .Protect ("pw123"), AllowFormattingRows:=True
    End With
    Application.ScreenUpdating = True
End Sub

Hope that helps.
 
Upvote 0
Success!! I knew there was an easy answer. I need to learn VBA better. thanks much!
 
Last edited:
Upvote 0
Don't forget that you can always record a macro of a series of keystrokes to give you the appropriate code.
You can then use, adapt, or extract as you see fit.
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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