Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
crs crs is offline
external usenet poster
 
Posts: 8
Default Formula to manipulate cell font

I realize that in some cases you can use conditional formatting to
change the color of the cell contents according to cell value, but I
need to change the color of one cell's contents according to the value
of a different cell. For instance....if B1 = x, then C1 is red but if
B1 = y, then C1 is blue..........any suggestions.
Clay

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Formula to manipulate cell font

You can do that with conditional formatting as well. You can change Cell
Value is to formula is and put in a formulat that refers to the other cell.

--
Regards,
Tom Ogilvy


"crs" wrote:

I realize that in some cases you can use conditional formatting to
change the color of the cell contents according to cell value, but I
need to change the color of one cell's contents according to the value
of a different cell. For instance....if B1 = x, then C1 is red but if
B1 = y, then C1 is blue..........any suggestions.
Clay


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Formula to manipulate cell font

You can still use conditional formatting. Change Cell Value is to Formula is.
The formula you want is =B1=x for one condition and for the second condition
=B1=y. set your font colors on each and you are good to go...
--
HTH...

Jim Thomlinson


"crs" wrote:

I realize that in some cases you can use conditional formatting to
change the color of the cell contents according to cell value, but I
need to change the color of one cell's contents according to the value
of a different cell. For instance....if B1 = x, then C1 is red but if
B1 = y, then C1 is blue..........any suggestions.
Clay


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default Formula to manipulate cell font

Clay, Try this. However, coding this depends on how many formatting
choices you want.

Sub TestFormat()
Dim MyCell As Range
For Each MyCell In Selection
If MyCell.Value = "x" Then
With MyCell.Offset(0, 1).Font
.Bold = True
.ColorIndex = 3
End With
Else
With MyCell.Offset(0, 1).Font
.Bold = True
.ColorIndex = 5
End With
End If
Next MyCell
End Sub

crs wrote:
I realize that in some cases you can use conditional formatting to
change the color of the cell contents according to cell value, but I
need to change the color of one cell's contents according to the value
of a different cell. For instance....if B1 = x, then C1 is red but if
B1 = y, then C1 is blue..........any suggestions.
Clay


  #5   Report Post  
Posted to microsoft.public.excel.programming
crs crs is offline
external usenet poster
 
Posts: 8
Default Formula to manipulate cell font

Thanks so much for the quick response. The idea didn't even cross my
mind.

Clay
Tom Ogilvy wrote:
You can do that with conditional formatting as well. You can change Cell
Value is to formula is and put in a formulat that refers to the other cell.

--
Regards,
Tom Ogilvy


"crs" wrote:

I realize that in some cases you can use conditional formatting to
change the color of the cell contents according to cell value, but I
need to change the color of one cell's contents according to the value
of a different cell. For instance....if B1 = x, then C1 is red but if
B1 = y, then C1 is blue..........any suggestions.
Clay





  #6   Report Post  
Posted to microsoft.public.excel.programming
crs crs is offline
external usenet poster
 
Posts: 8
Default Formula to manipulate cell font

Thanks to everyone for the help -
Asking is one of the best ways to learn!

wrote:
Clay, Try this. However, coding this depends on how many formatting
choices you want.

Sub TestFormat()
Dim MyCell As Range
For Each MyCell In Selection
If MyCell.Value = "x" Then
With MyCell.Offset(0, 1).Font
.Bold = True
.ColorIndex = 3
End With
Else
With MyCell.Offset(0, 1).Font
.Bold = True
.ColorIndex = 5
End With
End If
Next MyCell
End Sub

crs wrote:
I realize that in some cases you can use conditional formatting to
change the color of the cell contents according to cell value, but I
need to change the color of one cell's contents according to the value
of a different cell. For instance....if B1 = x, then C1 is red but if
B1 = y, then C1 is blue..........any suggestions.
Clay


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
formula to change font or cell colour Dave Excel Worksheet Functions 3 November 25th 07 08:25 PM
Excel: How to insert carriage returns in a formula to manipulate t Cardinal2B Excel Worksheet Functions 1 June 21st 07 04:17 PM
How to Manipulate formula for Binomial Distribution GH Excel Worksheet Functions 3 August 24th 06 03:06 AM
Change font/cell color by Formula exutable Excel Worksheet Functions 4 April 24th 06 03:08 PM
different font format in the same cell but using a formula karlo[_3_] Excel Programming 1 April 7th 04 06:31 AM


All times are GMT +1. The time now is 07:30 AM.

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"