+ Reply to Thread
Results 1 to 7 of 7

Unlock a range of cells in a column ONLY when the first cell of that column has data.

  1. #1
    Registered User
    Join Date
    01-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Unlock a range of cells in a column ONLY when the first cell of that column has data.

    Hi Excel Gurus,

    I'm a humble basic user of Excel and I have zero knowledge of VBA. I have to bravely venture into it now... hopefully with your guidance.

    My challenge.

    1. The worksheet is protected and cells are locked, with the exception of certain cells which I need users to enter data.
    2. Only when users enter data (which is in the form of a date) in cell F3, cells F10:F54 are unlocked. Else the cells are locked.
    3. Cells F10:F54 are also bound be Data Validation; users can only enter "1", "0" or "L".
    4. This is repeated for column F to O.

    How do I do this?

    I'm a total noob at VBA.

    Thanks.

    PS. I've attempted to use some codes I found in this forum but nothing seems to happen... so I decided to just ask this...

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Unlock a range of cells in a column ONLY when the first cell of that column has data.

    try this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Unlock a range of cells in a column ONLY when the first cell of that column has data.

    Hi stnkynts,

    Its works to a degree. After I enter data in cell F3, the cells F10:F54 is unlocked and data can be entered.
    However, when I delete or clear the data in cel F3, the cells F10:F54 remains unlocked...
    Anyway to relock F10:F54? Better yet, anyway to clear and lock F10:F54 AFTER I clear/delete data in F3?

    Damien.

  4. #4
    Registered User
    Join Date
    01-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Unlock a range of cells in a column ONLY when the first cell of that column has data.

    I did some investigation and realised that when the sheet is unprotect and cells unlocked, the macros changed the cells to be permanently unlocked. So I have to reset it again in order for the macros to work... how do I address this?

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Unlock a range of cells in a column ONLY when the first cell of that column has data.

    Anyway to relock F10:F54? Better yet, anyway to clear and lock F10:F54 AFTER I clear/delete data in F3?
    Please Login or Register  to view this content.
    I did some investigation and realised that when the sheet is unprotect and cells unlocked, the macros changed the cells to be permanently unlocked.
    It works just fine for me

  6. #6
    Registered User
    Join Date
    01-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Unlock a range of cells in a column ONLY when the first cell of that column has data.

    stnkynts,

    Thanks! It works!


    Much much thanks.

    Damien.

  7. #7
    Registered User
    Join Date
    01-05-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Unlock a range of cells in a column ONLY when the first cell of that column has data.

    stnkynts,

    I've marked this thread as solved... much thanks to you.

    There is a slight glitch that I can live with, but if it could be addressed it would be great.

    When the data in F3 is in the date format, I get a runtime error at the line [ If Target.Value = "" Then ].
    Any solution?

    Thanks.
    Damien.

+ 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. [SOLVED] Distribution of Cells in a Column Based on Cell Data in Another Column
    By leoxanigm in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-27-2013, 04:29 AM
  2. [SOLVED] Cond. formatting a column/Range, highlight cell in column/range if equal to specific text
    By DFrank231 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2013, 03:35 PM
  3. Replies: 3
    Last Post: 02-13-2013, 04:05 PM
  4. How to lock and unlock a range of cells based on certain cell's value?
    By potato in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-25-2012, 04:34 AM
  5. Macro broken - copy data range column to empty data range column
    By Cascus in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-06-2011, 05:20 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