PC Review


Reply
Thread Tools Rate Thread

Compare font colors

 
 
gary
Guest
Posts: n/a
 
      7th Nov 2011
How can I write a formula to compare the contents of two cells and do
one thing if the font colors are the same and do a different thing if
the font colors are different?

 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      8th Nov 2011
On Nov 7, 5:56*pm, gary <gcott...@hotmail.com> wrote:
> How can I write a formula to compare the contents of two cells and do
> one thing if the font colors are the same and do a different thing if
> the font colors are different?


How did the fonts become colored, manually, or by conditional
formatting?
Also, which version of excel ________?
 
Reply With Quote
 
gary
Guest
Posts: n/a
 
      8th Nov 2011
On Nov 7, 4:07*pm, Don Guillett <dguille...@gmail.com> wrote:
> On Nov 7, 5:56*pm, gary <gcott...@hotmail.com> wrote:
>
> > How can I write a formula to compare the contents of two cells and do
> > one thing if the font colors are the same and do a different thing if
> > the font colors are different?

>
> How did the fonts become colored, manually, or by conditional
> formatting?
> Also, which version of excel ________?


Manually.
 
Reply With Quote
 
gary
Guest
Posts: n/a
 
      8th Nov 2011
On Nov 7, 4:15*pm, gary <gcott...@hotmail.com> wrote:
> On Nov 7, 4:07*pm, Don Guillett <dguille...@gmail.com> wrote:
>
> > On Nov 7, 5:56*pm, gary <gcott...@hotmail.com> wrote:

>
> > > How can I write a formula to compare the contents of two cells and do
> > > one thing if the font colors are the same and do a different thing if
> > > the font colors are different?

>
> > How did the fonts become colored, manually, or by conditional
> > formatting?
> > Also, which version of excel ________?

>
> Manually.


Microsoft Office Excel 2007.

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      8th Nov 2011
On Nov 7, 6:19*pm, gary <gcott...@hotmail.com> wrote:
> On Nov 7, 4:15*pm, gary <gcott...@hotmail.com> wrote:
>
> > On Nov 7, 4:07*pm, Don Guillett <dguille...@gmail.com> wrote:

>
> > > On Nov 7, 5:56*pm, gary <gcott...@hotmail.com> wrote:

>
> > > > How can I write a formula to compare the contents of two cells and do
> > > > one thing if the font colors are the same and do a different thing if
> > > > the font colors are different?

>
> > > How did the fonts become colored, manually, or by conditional
> > > formatting?
> > > Also, which version of excel ________?

>
> > Manually.

>
> Microsoft Office Excel 2007.


Sub ifManualColor()For Each c In Range("R1:R6")'MsgBox
c.Interior.ColorIndexIf c.Interior.ColorIndex = 36 ThenMsgBox
cElse'whatEnd IfNext cEnd Sub
 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      8th Nov 2011
On Nov 8, 7:05*am, Don Guillett <dguille...@gmail.com> wrote:
> On Nov 7, 6:19*pm, gary <gcott...@hotmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 7, 4:15*pm, gary <gcott...@hotmail.com> wrote:

>
> > > On Nov 7, 4:07*pm, Don Guillett <dguille...@gmail.com> wrote:

>
> > > > On Nov 7, 5:56*pm, gary <gcott...@hotmail.com> wrote:

>
> > > > > How can I write a formula to compare the contents of two cells and do
> > > > > one thing if the font colors are the same and do a different thing if
> > > > > the font colors are different?

>
> > > > How did the fonts become colored, manually, or by conditional
> > > > formatting?
> > > > Also, which version of excel ________?

>
> > > Manually.

>
> > Microsoft Office Excel 2007.

>
> Sub ifManualColor()For Each c In Range("R1:R6")'MsgBox
> c.Interior.ColorIndexIf c.Interior.ColorIndex = 36 ThenMsgBox
> cElse'whatEnd IfNext cEnd Sub


OK you did ask for font color and a formula. How about a UDF?
Put this in a REGULAR module and then simply use =ic(a2) to check for
blue font

Function ic(x As Range)
If x.Font.ColorIndex = 5 Then
ic = "blue"
Else
ic = "notblue"
End If
End Function



 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      8th Nov 2011
On Nov 8, 7:05*am, Don Guillett <dguille...@gmail.com> wrote:
> On Nov 7, 6:19*pm, gary <gcott...@hotmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > On Nov 7, 4:15*pm, gary <gcott...@hotmail.com> wrote:

>
> > > On Nov 7, 4:07*pm, Don Guillett <dguille...@gmail.com> wrote:

>
> > > > On Nov 7, 5:56*pm, gary <gcott...@hotmail.com> wrote:

>
> > > > > How can I write a formula to compare the contents of two cells and do
> > > > > one thing if the font colors are the same and do a different thing if
> > > > > the font colors are different?

>
> > > > How did the fonts become colored, manually, or by conditional
> > > > formatting?
> > > > Also, which version of excel ________?

>
> > > Manually.

>
> > Microsoft Office Excel 2007.

>
> Sub ifManualColor()For Each c In Range("R1:R6")'MsgBox
> c.Interior.ColorIndexIf c.Interior.ColorIndex = 36 ThenMsgBox
> cElse'whatEnd IfNext cEnd Sub


I thought I had posted this. Put in regular module and then =ic(a2) to
check for blue

Function ic(x As Range)If x.Font.ColorIndex = 5 Thenic = "blue"Elseic
= "notblue"End IfEnd Function
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:36 PM.