View Single Post
  #3   Report Post  
Rowan
 
Posts: n/a
Default

A formula cannot be used to modifiy the format of a cell, it just returns a
value.

Excel (2002/2003) will allow you to part format the font of a cell if it
contains text but not if it contains a formula. So if you want your result to
be dynamic and keep the formula in the cell I don't believe you can have
different font colours.

If you are happy to replace the formula with its result in text format then
you could do it with a macro like this (select the cell containing the
formula first):

Sub FText()
Dim Prec As Range
Dim cell As Range
Dim TLen As Integer
Set Prec = ActiveCell.DirectPrecedents
TLen = 1
With ActiveCell
.NumberFormat = "@"
.Value = .Value
End With
For Each cell In Prec
ActiveCell.Characters(TLen, Len(cell.Text)).Font.ColorIndex = _
cell.Font.ColorIndex
TLen = TLen + Len(cell.Text)
Next cell
End Sub

Hope this helps
Rowan

"JMCA2000" wrote:

WHEN I COMBINE TEXT ( EX. =A1&B1&C1) WITH DIFFERENT FONT COLORS, IT RETURNS
THE COMBINED TEXT IN A SINGLE COLOR FONT. HOW DO I CORRECT THIS SO THE TEXT
IS RETURNED (COMBINED) IN THE ORIGINAL FONT COLOR FORMAT FROM THE ORIGINAL
INDIVIDUAL CELLS (A1 B1 C1)?