View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Brown[_5_] Gary Brown[_5_] is offline
external usenet poster
 
Posts: 236
Default VBA Conditional Formating Using Logical Expression

Using Conditional Formating, you can only have 3 different formats.
Each area you select, however, can have different formatting.
For example, if you want different conditional formatting for each of the 5
columns (with only 3 different formats per column)...

- Assume Range 1 is in column A
- Assume the columns in Range 2 are F, G, H, I and J.
- Assume data starts in row 2
- Let's start with column F...
- Highlight Column F
- select FORMAT CONDITIONAL FORMATTING...
- change 'Cell Value Is' to 'Formula is'
- put desired formula in the text box
- something like...
=$A1=1
- NOTE that the absolute ($) is only on the 'A' AND there is an '=' sign
after the $A1

--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown



"599R" wrote:

I am new to VBA so please provide as much explanation in your responses as
possible as I would love to learn more.

I have a set of data (call it range 1) that resides in specific cells (all
in one column) and does not change. I have another set of data (call it
range 2) that is spread across 5 columns and occupies the same rows as range
1. Range 2 values in each of the 5 columns relate to the Range 1 data in the
same row. I need to set up more than three conditions using , <, = or n/a
to determine the color of each of the cells in range 2.

As data is entered into the cells of range 2 the interior color of each cell
needs to change based on how it compares to the value found in range 1. I
have used select case to setup conditional formatting in the past, but am
struggling with the setup for this situation. How do I make this work?

I would prefer not to use the conditional formatting tab to carry this task
out as there may be more varioations than that feature will allow.

Please hlep - thank you