+ Reply to Thread
Results 1 to 11 of 11

Spell check unprotected cells in a protected worksheet

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    29

    Spell check unprotected cells in a protected worksheet

    I only found one other question like this posted in 2006. With no resolution. So I decided to ask it again.
    I have a protected sheet with unprotected cells allowing users to input data in the field. How can I get spell check to work on these unprotected cells? Using Excel 2010.
    Last edited by Dragman; 08-10-2015 at 02:13 PM. Reason: Added version

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Spell check unprotected cells in a protected worksheet

    Hi there,

    Try the following code and see if it does what you need:

    Please Login or Register  to view this content.
    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    10-10-2013
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Spell check unprotected cells in a protected worksheet

    I will try this out and see. Keeping fingers crossed.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Spell check unprotected cells in a protected worksheet

    Ok, please keep me informed.

    Greg M

  5. #5
    Registered User
    Join Date
    10-10-2013
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Spell check unprotected cells in a protected worksheet

    Greg

    I tried the code and it works.... that is until I protect the sheet. I get an error message and the debugger highlites the following line:

    rCell.CheckSpelling SpellLang:=2057

    Would it be better to specifically name the range I am working with? In the sheet the range is $R$7:$R$340. Not being a great VB coder (like yourself where would I include this information? Would I need to create a range of just the unprotected cells? That would be a pain for sure. (They are not sequential) So far so good. I look forward to your reply.

    Brian.

  6. #6
    Registered User
    Join Date
    10-10-2013
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Spell check unprotected cells in a protected worksheet

    here is a copy of the error message:

    Run-time error '1004':

    CheckSpelling method of Range class failed

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Spell check unprotected cells in a protected worksheet

    Hi again,

    I can't believe I never realised that spellchecking can't be performed while a worksheet is protected

    The following code provides a workaround for the above restriction. The code is very slightly more sophisticated than a simple temporary unprotecting of the worksheet, because it checks only those cells which are unlocked - this means that Users will not have any possibility of correcting misspellings (or words which Excel "thinks" are misspellings) which are located in locked cells.

    Please Login or Register  to view this content.
    Hope this workaround is useful for you - as always, please keep me informed.

    Regards,

    Greg M

  8. #8
    Registered User
    Join Date
    10-10-2013
    Location
    Edmonton, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    29

    Re: Spell check unprotected cells in a protected worksheet

    Success!! Your code worked well. Thank you!! And my users will thank you!!!

    Only one thing, the macro does expose your password. I will remove the developer tab from the ribbon, but it is still a security risk as you can't protect the ribbon from edits?

    Or can you????

    Brian.

  9. #9
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,640

    Re: Spell check unprotected cells in a protected worksheet

    Hi again,

    Many thanks for your feedback - glad I was able to help.

    There are various ways of making your password more secure - the more "savvy" your Users are, the better it has to be hidden.

    Sometimes I "hide" a password on a VeryHidden worksheet or as a Defined Name on a VeryHidden worksheet, and write a function to extract the value from there. This obviously isn't secure if your Users know how to read VBA code. A more secure way is to password-protect the VBA Project itself - you can do this using the VBA Project Properties DialogBox - it can be a bit of a pain when you're at the development stage because you need to enter the password every time you open the workbook. Anyway, some food for thought!

    Anything else, feel free to ask.

    Best regards,

    Greg M

  10. #10
    Registered User
    Join Date
    05-23-2022
    Location
    Stockton on Tees
    MS-Off Ver
    365
    Posts
    1

    Re: Spell check unprotected cells in a protected worksheet

    Hi All

    I know this is an old thread but wondering if anyone is still around to be able to help. I used the above code in a test sheet and it worked perfectly but when I put it into my sheet it didnt pick up the spelling mistakes. The cells are merged. When I unmerged the cells it picked them up. Is there anything I can do so it picks up the spelling mistakes in merged cells. the sheet has titles and reference cells above the data entry so need the merged cells for formatting purposed

    Thanks

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,044

    Re: Spell check unprotected cells in a protected worksheet

    Quote Originally Posted by andyccm View Post
    Hi All

    I know this is an old thread but wondering if anyone is still around to be able to help. I used the above code in a test sheet and it worked perfectly but when I put it into my sheet it didnt pick up the spelling mistakes. The cells are merged. When I unmerged the cells it picked them up. Is there anything I can do so it picks up the spelling mistakes in merged cells. the sheet has titles and reference cells above the data entry so need the merged cells for formatting purposed

    Thanks
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 09-10-2012, 12:03 PM
  2. Enabling Spell check on unlocked cells in a protected worksheet
    By Michelle.James in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2006, 11:55 AM
  3. Spell Check cells in Protected Worksheet?
    By Jugglertwo in forum Excel General
    Replies: 1
    Last Post: 07-27-2006, 03:30 PM
  4. Replies: 1
    Last Post: 03-30-2006, 06:45 PM
  5. [SOLVED] Spell Check in Protected Worksheet & Shared Workbook
    By DaveyC4S in forum Excel General
    Replies: 6
    Last Post: 10-28-2005, 08:05 AM
  6. [SOLVED] Spell Check in Protected Worksheet & Shared Workbook continued
    By DaveyC4S in forum Excel General
    Replies: 1
    Last Post: 10-25-2005, 02:05 PM
  7. Allow unprotected cells to spell check after sheet is protected
    By Numberonekraut (Hans) in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-15-2005, 03:05 PM
  8. spell check for protected worksheet for Excel 97
    By Jessica in forum Excel General
    Replies: 1
    Last Post: 03-18-2005, 02:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1