View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Herbert Seidenberg Herbert Seidenberg is offline
external usenet poster
 
Posts: 1,180
Default Another Question

Here is a way without VBA or Excel4 macro functions.
Disadvantage: Each color is restricted to a maximum of 33
non-contiguous areas.
This method consists of finding and naming
all cells of a certain color.
The if() function then tests if a cell belongs to a given name.
Assume this list is at A1 with background colors matching
the cell content:

green1
orange1
red1
blue1
yellow1
red2
yellow2
green2
yellow3
orange2
blue2
red3
green3
yellow4
orange3
blue3
yellow5
green4
red4
orange4

Select A1:A20 Edit Find Find what: clear content
Options Format Choose format from cell
click a sample cell (say A1) Find All
SHIFT+END (this will select A1, A8, A13, A18)
Insert Name Define Names in workbook: GreenC

or enter GreenC into the Name Box.
At B1 enter this sample if() formula and copy down:
=IF(ISERROR(GreenC $A1),"",$A1)
All the green cells will have an entry in column B.
To maximize the number of named colored cells/areas,
keep the sheet name short (one letter) and work in the area
of the sheet that has single row/column digits/letters.