Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Spell Check Protect Reprotect with same settings

Hello. I've been able to use below vb to spell check 'while protected'. My
issue is that i want to allow the user to be able to formatt columns and rows
(resize). When i execute the macro it clears those check marks from
protection list. Hoping someone can advise. Thank you
------------
Requires VBA to unprotect the sheet, do the spellcheck then reprotect the
sheet.

Similar to.......

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub


Gord Dibben Excel MVP


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Spell Check Protect Reprotect with same settings

Using the macro recorder will generally give you the code you need for
allowing elements when protection is enabled.

Try this................

Sub Spell_Check()
With ActiveSheet
.Unprotect Password:="justme"
.Cells.CheckSpelling SpellLang:=1033
.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True _
, AllowFormattingColumns:=True, AllowFormattingRows:=True, _
AllowInsertingColumns:=True, AllowInsertingRows:=True
.EnableSelection = xlNoRestrictions
End With
End Sub

For EnableSelection you have 3 properties. Edit to suit.

xlNoSelection
xlNoRestrictions
xlUnlockedCells


Gord Dibben MS Excel MVP

On Sat, 9 Jan 2010 14:39:02 -0800, PatriciaT
wrote:

Hello. I've been able to use below vb to spell check 'while protected'. My
issue is that i want to allow the user to be able to formatt columns and rows
(resize). When i execute the macro it clears those check marks from
protection list. Hoping someone can advise. Thank you
------------
Requires VBA to unprotect the sheet, do the spellcheck then reprotect the
sheet.

Similar to.......

Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub


Gord Dibben Excel MVP


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect then reprotect using macro checkQ Excel Discussion (Misc queries) 2 October 13th 07 05:12 PM
Spell Check Mishka Excel Worksheet Functions 1 March 1st 07 08:51 PM
Spell check Tonks Excel Worksheet Functions 2 July 31st 06 11:44 AM
... Can I set Spell Check to automatically check my spelling ... Dr. Darrell Setting up and Configuration of Excel 0 March 21st 06 08:26 PM
How can I protect a cell and keep the spell check working? ochoaex Excel Discussion (Misc queries) 1 February 3rd 06 08:25 PM


All times are GMT +1. The time now is 10:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"