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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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,215,514
Messages
6,125,269
Members
449,219
Latest member
daynle

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