View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How to give numbers to the font colors

If A1 contains colored values, then
=fontcolor(A1) will return the number of the font. The UDF is:

Function fontcolor(r As Range)
fontcolor = r.Font.ColorIndex
End Function

--
Gary''s Student - gsnu200739


"Igneshwara reddy" wrote:

Hi,

I have some data in A column. for Ex:
Column "A"
ABC - this is in red color font - For red color 1
DEF - this is in black color font - for Black color 2
GHI - this is in green color font - for Green color 3
JKL - this is in yellow color font - for Yellow color 4

Based on the color of the fonts I need to assign numbers like 1,2,3,4,.

Please let me know how can i proceed.

Thanks and regards,
Igneshwara reddy