Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Cell formatting and if statement

Is there a way to trigger an if statement based on the formatting of a
cell as opposed to the value in the cell?

I have a worksheet that displays channel frequencies in a grid
corresponding to various cities. All locations have each frequency,
but in some cities a given frequency can be in stereo or mono. In the
grid, a location with a frequency in stereo is denoted by a different
colour of text.

I would like to run an if statement from a macro that goes something
like:

if(textcolor(A1)=blue, true, false)

I assume that this isn't possible, but I am not confident enough to
give up on it.

Any help would be appreciated,
Thanks,
TK
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Cell formatting and if statement

Have yoiu considered conditional formatting? This automatically formats the
cell based on its contents. Look under Format/Conditional Formatting.

"Cortez" wrote:

Is there a way to trigger an if statement based on the formatting of a
cell as opposed to the value in the cell?

I have a worksheet that displays channel frequencies in a grid
corresponding to various cities. All locations have each frequency,
but in some cities a given frequency can be in stereo or mono. In the
grid, a location with a frequency in stereo is denoted by a different
colour of text.

I would like to run an if statement from a macro that goes something
like:

if(textcolor(A1)=blue, true, false)

I assume that this isn't possible, but I am not confident enough to
give up on it.

Any help would be appreciated,
Thanks,
TK

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Cell formatting and if statement

I am not trying to change the formatting of the cells. I have
multiple cells with the same values, but the existing formatting
differs from cell to cell which denotes a significant variation.

I will reword my example in case it wasn't clear.

here is a sample of what I am looking for, but I don't know if there
is a means of doing it in a macro, or what the syntax would be:

For this example cell A1 contains the value 15 and is in blue text.

if cells(1, 1).TEXTCOLOR = BLUE then cells(1,2).value = "Stereo"

In other words, If the text in cell A1 is blue, then change the text
in B1 to say "stereo".

TK

On Feb 12, 3:06*pm, mray29 wrote:
Have yoiu considered conditional formatting? This automatically formats the
cell based on its contents. Look under Format/Conditional Formatting.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default Cell formatting and if statement

I have figured this out on my own, so I thought I would share it he

If Cells(1, 1).Font.ColorIndex = 5 Then Sheet5.Cells(1, 2).Value =
"stereo"

colorindex 5 is the blue I need, other colors have different
corresponding colorindex values.

This does what I needed, hope someone else finds it helpful.

Thanks,
TK
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
Formatting Cells using an If Statement Seanb Excel Worksheet Functions 5 September 6th 07 05:10 PM
IF statement and color formatting for cell B1 for condition in A1 Rossta Excel Worksheet Functions 1 July 27th 06 12:37 AM
Can Excel cell formatting be included in an IF statement? neeses Excel Worksheet Functions 3 September 21st 05 07:42 PM
formatting a cell with a function (IF statement) Dreaming Excel Worksheet Functions 3 June 30th 05 02:26 AM
Formatting a cell with a function (IF statement) Dreaming Excel Worksheet Functions 2 June 30th 05 02:12 AM


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