Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default 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 FormatConditional 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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

FormatCFFormula is: =ISBLANK($B4)

Pick a color from FormatPatterns and OK your way out.


Gord Dibben Excel MVP

On 15 Dec 2005 16:32:52 -0800, "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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Format cell based on adjacent cells values

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sum only specific cells based on value in adjacent cell KKD Excel Discussion (Misc queries) 4 May 28th 09 04:18 PM
Sum of cells based on entry of adjacent cell cware Excel Worksheet Functions 2 June 19th 08 09:56 PM
Calculations based on adjacent cell values Jack Excel Discussion (Misc queries) 4 June 10th 06 02:39 PM
Conditional coloring of Excel cells, based on adjacent cell values? Greg Stuart Excel Worksheet Functions 0 March 10th 06 10:14 PM
I want to format a cell based on an adjacent cells value Cumbo Excel Discussion (Misc queries) 1 December 13th 04 11:52 AM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"