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!
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.