Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Comparing Fill Color


Is there a way for me to determine the current fill color of a cell?

For example if the cell is red filled, I do not want to change the
color. But if it is any other color, I would would overlay with a
color.

I'm using VBA to comparing 2 fields values and then color filling
another based on the result. The code works fine but I do not want RED
fill to be overlaid.


--
magoobee
------------------------------------------------------------------------
magoobee's Profile: http://www.excelforum.com/member.php...o&userid=21581
View this thread: http://www.excelforum.com/showthread...hreadid=478811

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Comparing Fill Color

Enter this small UDF:

Function clr(R As Range) As Integer
With R.Interior
clr = .ColorIndex
End With
End Function

Use it like =clr(A1). It will return a number corresponding to the
interior color of A1
--
Gary''s Student


"magoobee" wrote:


Is there a way for me to determine the current fill color of a cell?

For example if the cell is red filled, I do not want to change the
color. But if it is any other color, I would would overlay with a
color.

I'm using VBA to comparing 2 fields values and then color filling
another based on the result. The code works fine but I do not want RED
fill to be overlaid.


--
magoobee
------------------------------------------------------------------------
magoobee's Profile: http://www.excelforum.com/member.php...o&userid=21581
View this thread: http://www.excelforum.com/showthread...hreadid=478811


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
fill color and font color icons do not work in excel huer59 Excel Discussion (Misc queries) 0 November 29th 07 01:06 PM
color fill button is not adding color to my spread sheet mitchnmd Excel Worksheet Functions 1 September 26th 07 04:36 PM
My fill color and font color do not work in Excel Std Edition 2003 chapstick Excel Discussion (Misc queries) 1 September 11th 05 08:48 PM
Excel 2003 will not display color fonts or color fill cells DaveC Excel Worksheet Functions 1 April 11th 05 04:38 PM
My excel 2003 wont let me fill cells with color or color the tabs. trizog New Users to Excel 2 February 22nd 05 06:43 PM


All times are GMT +1. The time now is 04:15 PM.

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

About Us

"It's about Microsoft Excel"