Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How can you flag a cell with fill colour

I am trying to write a formula that tells me if a cell is not white and
return a flag.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default How can you flag a cell with fill colour

depends somewhat too on how you mean to 'flag' them....in this code i add a
new worksheet....

Option Explicit
Sub FlagColoredCells()
Dim ws As Worksheet 'for results
Dim cell As Range ' for find
Dim rowindex ' for results

For Each cell In ActiveSheet.UsedRange
If cell.Interior.ColorIndex < xlNone Then
If ws Is Nothing Then
Set ws = Worksheets.Add
rowindex = 1
End If
ws.Cells(rowindex, 1) = cell.Address
ws.Cells(rowindex, 2) = cell.Interior.ColorIndex
rowindex = rowindex + 1
End If
Next
End Sub


"birdnat" wrote in message
...
I am trying to write a formula that tells me if a cell is not white and
return a flag.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How can you flag a cell with fill colour

you can use a worksheet function CELL
=cell("color",A1)

returns 1 if the cell is formatted in color for negative values; otherwise
returns 0 (zero).

This function and Patrick's solution will not work if the cell is colored
using conditional formating.

"Patrick Molloy" wrote:

depends somewhat too on how you mean to 'flag' them....in this code i add a
new worksheet....

Option Explicit
Sub FlagColoredCells()
Dim ws As Worksheet 'for results
Dim cell As Range ' for find
Dim rowindex ' for results

For Each cell In ActiveSheet.UsedRange
If cell.Interior.ColorIndex < xlNone Then
If ws Is Nothing Then
Set ws = Worksheets.Add
rowindex = 1
End If
ws.Cells(rowindex, 1) = cell.Address
ws.Cells(rowindex, 2) = cell.Interior.ColorIndex
rowindex = rowindex + 1
End If
Next
End Sub


"birdnat" wrote in message
...
I am trying to write a formula that tells me if a cell is not white and
return a flag.


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
cell colour fill ko Excel Discussion (Misc queries) 5 August 13th 08 07:38 AM
How do I get more colour choices to fill a cell? CathieC Excel Worksheet Functions 1 April 2nd 08 11:20 PM
Setting cell fill colour Jacetech Excel Programming 2 March 16th 08 03:46 PM
Having a due date flag in a different colour 30 days from current. mike099 Excel Worksheet Functions 1 January 20th 05 03:34 AM
Changing Cell Fill Colour Nick Excel Discussion (Misc queries) 4 December 6th 04 10:05 PM


All times are GMT +1. The time now is 11:11 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"