+ Reply to Thread
Results 1 to 4 of 4

conditional locking and unlocking of column cells

  1. #1
    Registered User
    Join Date
    01-02-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Lightbulb conditional locking and unlocking of column cells

    Hello,

    I want to create a table in excel,such that

    if there are 3 columns(a,b,c) then

    if data is entered in cells of column A then cells in column's B and c should be locked.

    If data in cells of column A is deleted or if the cell's in A are empty then columns B and C should be unlocked.

    can some one tell me how to do this.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Try this
    Please Login or Register  to view this content.
    This code uses a Worksheet event and is stored ion a worksheet module. To add it to your worksheet, do the following:

    Copy the codee
    Select the worksheet in which you the code to run
    Right click on the sheet tab and choose View Code, to open the Visual Basic Editor.
    Where the cursor is flashing, choose Edit | Past
    e
    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-02-2009
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4
    Hey ,

    thanks a lot for your help.

    but the code is not working.

    Copied the code into the worksheet the way its mentioned and saved it.

    After saving it ,opened sheet 1 and entered data into Cells of columns A.

    columns B,C are not getting locked.

    I even tried the code protecting the sheet.

    its not working ,do i need to do any more steps before executing the code.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    By default all cells in a worksheet are locked. You need to first unlock all cells

    Format->Cells->Protection then clear the locked box

+ 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