Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hi, I\'m running Excel 2010 and I have a number of sheets protected. When protec

ID: 3564159 • Letter: H

Question

Hi,

I'm running Excel 2010 and I have a number of sheets protected. When protecting the sheet I have the following options selected.

The "Format Cells" option is really just to allow the users to merge cells together.

I have a button Macro running aa spsell check, which works great. However once the button has been pressed the user can no longer mergee the cells.

When i go bacck into Protect Sheet I notice the "Format Cells" box is un-ticked. The code for the spell check is the one below:

Sub Button2_Click()
ActiveSheet.Unprotect Password:="password"
Cells.CheckSpelling CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, AlwaysSuggest:=True, SpellLang:=2057 '1033
ActiveSheet.Protect Password:="password"
End Sub

Can someone help me with a piece of code that allows the Format Cells box to remain ticked after the spell check has been completed please?

Many Thanks,

Explanation / Answer

Not a VBA expert either ;-). It looks like you forgot the comma before AllowFormattingCells:=True and reading my post that's my fault :-( - sincere apologies

Have a look to the line of code above ActiveSheet.Protect... Parameters are separated by commas and as far as I know there is no exception to this in VBA when functions are called.

Hope this helps

Cheers!

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote