#1   Report Post  
JMCA2000
 
Posts: n/a
Default FONT COLOR FORMAT

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)?
  #2   Report Post  
Michael
 
Posts: n/a
Default

Hi
Excel doesn't allow partial formatting of cells and hence will return the
default format.
You may be able to do it with VBA, but I don't think so.

Oh, BTW, please don't post in capitals as it is considered to be shouting as
well as being really hard to read.

HTH
Michael Mitchelson


"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)?

  #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)?

  #4   Report Post  
Piranha
 
Posts: n/a
Default


JM,

This will Format partial text in a cell. You may be able to change
it for your application. And put a target in instead of active cell.

Sub format()
With ActiveCell.Characters(Start:=4, Length:=3).Font
.FontStyle = "Bold"
.FontStyle = "Regular"
.Color = vbRed
.Name = "Arial"
.Size = 10
.ColorIndex = 1
End With
End Sub

"Start" is how many characters from the left you want the formating to
start.
"Length" is how many characters you want the formating to continue.


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)?



--
Piranha


------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=397654

  #5   Report Post  
JMCA2000
 
Posts: n/a
Default

Thank You for your support!!!

I have no problem using another column for the formula and then referencing
another column for the results.

I am not sure what you are suggesting or how to do this. I did not find a
function in the Excel help called Sub format() and I don't know how to create
this type of Macro with the Macro recorder.

I would Greatly Appreciate your further support with this issue.

For Your Information:
The text from any one of the original columns row(same row) (A1 B1 C1, A2
B2 C2, A3 B3 C3, etc.) is only one letter (O Blank Blank, Blank S Blank,
Blank Blank R, etc.) and the result in the reference column will only contain
one letter from each of the original columns row (A1 B1 C1, etc.). The reason
why I need the different color font letters is because the results will be a
continuous string of single letters in the resulting column and the different
color letters will tell me what was the original column that it came from
when scrolling down.

Thank You Again For Your Continually Support!!!

"Piranha" wrote:


JM,

This will Format partial text in a cell. You may be able to change
it for your application. And put a target in instead of active cell.

Sub format()
With ActiveCell.Characters(Start:=4, Length:=3).Font
.FontStyle = "Bold"
.FontStyle = "Regular"
.Color = vbRed
.Name = "Arial"
.Size = 10
.ColorIndex = 1
End With
End Sub

"Start" is how many characters from the left you want the formating to
start.
"Length" is how many characters you want the formating to continue.


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)?



--
Piranha


------------------------------------------------------------------------
Piranha's Profile: http://www.excelforum.com/member.php...o&userid=20435
View this thread: http://www.excelforum.com/showthread...hreadid=397654




  #6   Report Post  
JMCA2000
 
Posts: n/a
Default

Thank You for your support!!!

I have no problem using another column for the formula and then referencing
another column for the results.

I am not sure what you are suggesting or how to do this. I did not find a
function in the Excel help called Sub FText() and I don't know how to create
this type of Macro with the Macro recorder.

I would Greatly Appreciate your further support with this issue.

For Your Information:
The text from any one of the original columns row(same row) (A1 B1 C1, A2
B2 C2, A3 B3 C3, etc.) is only one letter (O Blank Blank, Blank S Blank,
Blank Blank R, etc.) and the result in the reference column will only contain
one letter from each of the original columns row (A1 B1 C1, etc.). The reason
why I need the different color font letters is because the results will be a
continuous string of single letters in the resulting column and the different
color letters will tell me what was the original column that it came from
when scrolling down.

Thank You Again For Your Continually Support!!!

"Michael" wrote:

Hi
Excel doesn't allow partial formatting of cells and hence will return the
default format.
You may be able to do it with VBA, but I don't think so.

Oh, BTW, please don't post in capitals as it is considered to be shouting as
well as being really hard to read.

HTH
Michael Mitchelson


"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)?

  #7   Report Post  
JMCA2000
 
Posts: n/a
Default

Thank You for your support!!!

I have no problem using another column for the formula and then referencing
another column for the results.

I am not sure what you are suggesting or how to do this. I did not find a
function in the Excel help called Sub FText() and I don't know how to create
this type of Macro with the Macro recorder.

I would Greatly Appreciate your further support with this issue.

For Your Information:
The text from any one of the original columns row(same row) (A1 B1 C1, A2
B2 C2, A3 B3 C3, etc.) is only one letter (O Blank Blank, Blank S Blank,
Blank Blank R, etc.) and the result in the reference column will only contain
one letter from each of the original columns row (A1 B1 C1, etc.). The reason
why I need the different color font letters is because the results will be a
continuous string of single letters in the resulting column and the different
color letters will tell me what was the original column that it came from
when scrolling down.

Thank You Again For Your Continually Support!!!

"Rowan" wrote:

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)?

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
Moving Excel Charts into Word Documents: font sizes change Sam Charts and Charting in Excel 4 June 24th 05 09:01 PM
Changing default font for copy / paste LaMonk Excel Discussion (Misc queries) 1 June 23rd 05 06:43 PM
Why is first font action v-e-r-y slow? [email protected] Excel Discussion (Misc queries) 2 March 11th 05 08:01 AM
xl chart font sizing into PPT Brian Reilly, MS MVP Charts and Charting in Excel 1 January 12th 05 02:58 AM
How to change the default font and size of "comments"? ClayMcQ Excel Discussion (Misc queries) 1 January 7th 05 11:43 PM


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