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

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
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,056
Messages
6,122,907
Members
449,096
Latest member
dbomb1414

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