+ Reply to Thread
Results 1 to 3 of 3

Lock a cell based on another cells content

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    Wellingborough, England
    MS-Off Ver
    Microsoft Office 2016 Professional
    Posts
    49

    Lock a cell based on another cells content

    Hi All,

    I would like some VBA help with locking a cell based on another cells content.

    If cell AT22 is greater than zero then lock cell D22

    I would like this to work from cell AT22:AT221 locking cells D22:D221

    Any suggestions would be welcomed ...

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,447

    Re: Lock a cell based on another cells content

    Hi,

    This should do as you require.

    Please Login or Register  to view this content.
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Lock a cell based on another cells content

    Hello Jalica,

    You may also want to consider this;

    First Select all the Cells in the whole sheet, and with Cells Formatting change its Protection> Locked to False(That is, uncheck the "Protection Box")

    In a Standard Module

    Please Login or Register  to view this content.
    In the Worksheet_Change Event

    Please Login or Register  to view this content.
    Regards.
    Attached Files Attached Files
    Last edited by Winon; 05-17-2018 at 10:28 AM. Reason: added more info
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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. Automaticaly lock cell based on content of another cell
    By Hippolyte in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-15-2016, 03:01 PM
  2. Automaticaly lock cell based on content of another cell
    By Hippolyte in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 12-14-2016, 05:11 PM
  3. [SOLVED] VBA lock cells based on their content
    By Sinon05 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-30-2015, 10:29 AM
  4. Lock/unlock specific cells in a row based on another cell content of the same row
    By st_rod000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2014, 02:58 AM
  5. Automatically copy cells content based on the content of another cell.
    By chrisbarlow1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2014, 11:13 AM
  6. Lock and clear cell content based on another cell's value
    By mohitmahajanin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2008, 06:30 AM
  7. Replies: 3
    Last Post: 10-23-2006, 08:57 AM

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