+ Reply to Thread
Results 1 to 3 of 3

Code to grey out and lock/unlock certain cells

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Code to grey out and lock/unlock certain cells

    Hi everyone

    I am relatively new to VBA and have attempted to write a code (see below) to grey out and lock certain cells depending on whether or not a certain value is entered to a dropdown list.

    Please Login or Register  to view this content.
    This seems to work fine until I protect the sheet, after which as soon as I change the value in cell "D24" I get a run-time error 1004 - Application defined or object defined error, with the debug highlighting this line:

    Please Login or Register  to view this content.
    Any ideas how I can fix this?

    Thanks in advance for the help!
    Last edited by Glensafro; 02-10-2012 at 11:59 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Code to grey out and lock/unlock certain cells

    Something like this

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-09-2012
    Location
    Thetford, England
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Code to grey out and lock/unlock certain cells

    Works great, thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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