+ Reply to Thread
Results 1 to 3 of 3

Shade & Lock Cells Based on another cell

  1. #1
    Forum Contributor
    Join Date
    10-03-2016
    Location
    Sydney, Australia
    MS-Off Ver
    MS 365
    Posts
    128

    Shade & Lock Cells Based on another cell

    Hi,

    Is it possible to shade and lock cells in a column based on the data on the same row in another column?

    In Column A, I will enter either "Asset" or "Peripheral".

    In Column B will be the information for anything classified as "Asset".

    In Column C will be the information for anything classified as "Peripheral".

    Therefore, if I enter "Asset" into A2, I want B2 to be available to enter data into but I want C2 to shade grey and lock the cell (there is information in the other columns from D, so I want to be able to hit the TAB button and it automatically skip over C2 and go to D2).

    Then, if I enter "Peripheral" into A3, I want B3 to shade grey and lock so that when I hit TAB, it skips over B3 and I can enter data into C3.

    Is this at all possible? I know I can hit TAB once or twice depending on the classification, but I will have other people using the workbook and they tend to make a lot of mistakes and put the wrong information in the wrong column.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Shade & Lock Cells Based on another cell

    My suggestion is to avoid unnecessary VBA.

    1) You can use CONDITIONAL FORMATTING in B2 and C2 to grey the cell out based on the value in A2. (make the cell and the font the same color of grey)

    2) You can use DATA VALIDATION in B2 and C2 to make the cell refuse to accept data based on the value in A2.

    I wouldn't fret the TAB thing, the Data Validation will not allow typing in the greyed out cell, so no worries there.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Contributor
    Join Date
    10-03-2016
    Location
    Sydney, Australia
    MS-Off Ver
    MS 365
    Posts
    128

    Re: Shade & Lock Cells Based on another cell

    Thanks JBeaucaire,

    The data validation won't work for column B as the value will always be different, out assets start with AA then have 5 numbers after it.

    I was also hoping to make the TAB thing work, as we use a barcode reader to scan codes, so if the cell became locked, the barcode reader would automatically skip to the next column, but no worries, thanks for your help anyway.

+ 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] lock cells based on negative value in another cell
    By tkinnard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-09-2016, 04:56 PM
  2. Replies: 3
    Last Post: 07-28-2013, 10:24 PM
  3. Macro to shade and lock cells
    By jan mason in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2013, 09:23 AM
  4. Replies: 2
    Last Post: 12-17-2011, 08:13 AM
  5. Lock cells within a row based on cell value
    By PY_ in forum Excel General
    Replies: 2
    Last Post: 11-14-2010, 12:40 AM
  6. VBA to SHADE cells based on: step-size & starting cell
    By zusammen in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-14-2009, 10:09 AM
  7. Use VBA to shade a cell and then lock
    By Danno72 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-17-2008, 09:25 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