+ Reply to Thread
Results 1 to 5 of 5

Format cell based on adjacent cells values

  1. #1
    the majestic ferny
    Guest

    Format cell based on adjacent cells values

    I searched through the group and saw that this is a fairly common
    question, but I'm afraid I don't have enough skills with VB to edit
    existing code to fit my needs. What I would like to have is workbook
    code that would check the active worksheet and highlight cells in
    column A (starting on the 4th row) if the adjacent cells in either
    column B or C are empty. If values are added to both adjacent cells
    then the highlighting is removed.
    Any code samples, tips, anything at all is greatly appreciated.
    Kind Regards.


  2. #2
    Rowan Drummond
    Guest

    Re: Format cell based on adjacent cells values

    You don't need any code for that, you can use Excel's built-in
    conditional formatting.

    Select the data in column A starting in Row4 that A4 is the activecell.
    A4 should be white and you should see A4 in the namebox on the formulabar.
    From the menus select Format>Conditional Formatting.
    Change the first dropdown box to "Formula Is".
    Then enter the formula:
    =OR(ISBLANK(B4),ISBLANK(C4))
    Click on Format and select the formatting you want.
    OK out.

    Hope this helps
    Rowan

    the majestic ferny wrote:
    > I searched through the group and saw that this is a fairly common
    > question, but I'm afraid I don't have enough skills with VB to edit
    > existing code to fit my needs. What I would like to have is workbook
    > code that would check the active worksheet and highlight cells in
    > column A (starting on the 4th row) if the adjacent cells in either
    > column B or C are empty. If values are added to both adjacent cells
    > then the highlighting is removed.
    > Any code samples, tips, anything at all is greatly appreciated.
    > Kind Regards.
    >


  3. #3
    Gord Dibben
    Guest

    Re: Format cell based on adjacent cells values

    You sure you want to use VBA?

    You can do what you want through Conditional Formatting easily.

    Select A4 to An

    Format>CF>Formula is: =ISBLANK($B4)

    Pick a color from Format>Patterns and OK your way out.


    Gord Dibben Excel MVP

    On 15 Dec 2005 16:32:52 -0800, "the majestic ferny" <[email protected]>
    wrote:

    >I searched through the group and saw that this is a fairly common
    >question, but I'm afraid I don't have enough skills with VB to edit
    >existing code to fit my needs. What I would like to have is workbook
    >code that would check the active worksheet and highlight cells in
    >column A (starting on the 4th row) if the adjacent cells in either
    >column B or C are empty. If values are added to both adjacent cells
    >then the highlighting is removed.
    >Any code samples, tips, anything at all is greatly appreciated.
    >Kind Regards.


  4. #4
    the majestic ferny
    Guest

    Re: Format cell based on adjacent cells values

    Thanks for the advice Rowan & Gord! Just want I needed.
    Kind Regards.


  5. #5
    the majestic ferny
    Guest

    Re: Format cell based on adjacent cells values

    Thanks for this. I noticed that if I enter values in the adjacent B
    and C cells, and then delete those values, the formatting doesn't
    reappear. ???


+ 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