Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default 2 different formats of text in a single cell?

Is it possible to have more than one format for a text string in a cell?

For example, I have the formula:

=i_currency&TEXT(+$C$13/landarea,"#,###.##")&"/"&landunit,"")

How can I bold or italicize part of the text string?

thanks
George

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default 2 different formats of text in a single cell?

You can't bold or italicize (or do any other font formatting to) part of a
string of text if that text is displayed as the result of a worksheet
formula... only text constants can have parts of its text formatted
differently from the rest.

--
Rick (MVP - Excel)


"mopgcw" wrote in message
...
Is it possible to have more than one format for a text string in a cell?

For example, I have the formula:

=i_currency&TEXT(+$C$13/landarea,"#,###.##")&"/"&landunit,"")

How can I bold or italicize part of the text string?

thanks
George


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default 2 different formats of text in a single cell?

Thanks, how would I format part of a text constant?



"Rick Rothstein" wrote:

You can't bold or italicize (or do any other font formatting to) part of a
string of text if that text is displayed as the result of a worksheet
formula... only text constants can have parts of its text formatted
differently from the rest.

--
Rick (MVP - Excel)


"mopgcw" wrote in message
...
Is it possible to have more than one format for a text string in a cell?

For example, I have the formula:

=i_currency&TEXT(+$C$13/landarea,"#,###.##")&"/"&landunit,"")

How can I bold or italicize part of the text string?

thanks
George



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default 2 different formats of text in a single cell?

If your text constant is abcdefghj, in the formula bar select the def, then
Format Cells will give you a font tab. Select the desired formatting, and
that will be applied to the def.
--
David Biddulph

"mopgcw" wrote in message
...
Thanks, how would I format part of a text constant?



"Rick Rothstein" wrote:

You can't bold or italicize (or do any other font formatting to) part of
a
string of text if that text is displayed as the result of a worksheet
formula... only text constants can have parts of its text formatted
differently from the rest.

--
Rick (MVP - Excel)


"mopgcw" wrote in message
...
Is it possible to have more than one format for a text string in a
cell?

For example, I have the formula:

=i_currency&TEXT(+$C$13/landarea,"#,###.##")&"/"&landunit,"")

How can I bold or italicize part of the text string?

thanks
George





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default 2 different formats of text in a single cell?

Enter the text "Some bold and red words" in A1 and then give this code a
try...

Sub Test()
Dim R As Range
Dim Word As String
Dim Position As Long
Set R = Range("A1")
' Clear any exiting font formatting
R.Characters.Font.Bold = False
R.Characters.Font.ColorIndex = xlAutomatic
' Make a word bold
Word = "Bold"
Position = InStr(1, R.Value, Word, vbTextCompare)
R.Characters(Position, Len(Word)).Font.Bold = True
' Make the color of a word red
Word = "red"
Position = InStr(1, R.Value, Word, vbTextCompare)
R.Characters(Position, Len(Word)).Font.ColorIndex = 3
End Sub

--
Rick (MVP - Excel)


"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
If your text constant is abcdefghj, in the formula bar select the def,
then Format Cells will give you a font tab. Select the desired
formatting, and that will be applied to the def.
--
David Biddulph

"mopgcw" wrote in message
...
Thanks, how would I format part of a text constant?



"Rick Rothstein" wrote:

You can't bold or italicize (or do any other font formatting to) part of
a
string of text if that text is displayed as the result of a worksheet
formula... only text constants can have parts of its text formatted
differently from the rest.

--
Rick (MVP - Excel)


"mopgcw" wrote in message
...
Is it possible to have more than one format for a text string in a
cell?

For example, I have the formula:

=i_currency&TEXT(+$C$13/landarea,"#,###.##")&"/"&landunit,"")

How can I bold or italicize part of the text string?

thanks
George








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default 2 different formats of text in a single cell?

David & Rick

THANKS, this was VERY helpful.

That's why this is such a great forum.

Take care,
George


"Rick Rothstein" wrote:

Enter the text "Some bold and red words" in A1 and then give this code a
try...

Sub Test()
Dim R As Range
Dim Word As String
Dim Position As Long
Set R = Range("A1")
' Clear any exiting font formatting
R.Characters.Font.Bold = False
R.Characters.Font.ColorIndex = xlAutomatic
' Make a word bold
Word = "Bold"
Position = InStr(1, R.Value, Word, vbTextCompare)
R.Characters(Position, Len(Word)).Font.Bold = True
' Make the color of a word red
Word = "red"
Position = InStr(1, R.Value, Word, vbTextCompare)
R.Characters(Position, Len(Word)).Font.ColorIndex = 3
End Sub

--
Rick (MVP - Excel)


"David Biddulph" <groups [at] biddulph.org.uk wrote in message
...
If your text constant is abcdefghj, in the formula bar select the def,
then Format Cells will give you a font tab. Select the desired
formatting, and that will be applied to the def.
--
David Biddulph

"mopgcw" wrote in message
...
Thanks, how would I format part of a text constant?



"Rick Rothstein" wrote:

You can't bold or italicize (or do any other font formatting to) part of
a
string of text if that text is displayed as the result of a worksheet
formula... only text constants can have parts of its text formatted
differently from the rest.

--
Rick (MVP - Excel)


"mopgcw" wrote in message
...
Is it possible to have more than one format for a text string in a
cell?

For example, I have the formula:

=i_currency&TEXT(+$C$13/landarea,"#,###.##")&"/"&landunit,"")

How can I bold or italicize part of the text string?

thanks
George







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
Multiple formats in a single cell with multiple formulas Zakhary Excel Worksheet Functions 1 May 2nd 08 12:08 AM
The Cell formats keep changing itself from text to date Hervinder Excel Discussion (Misc queries) 2 November 16th 06 03:56 PM
How do I keep cell color formats separate from text during A-Z sor aeromutt Excel Worksheet Functions 1 March 29th 06 06:18 AM
Multiple formats for a single cell value. Carlos Excel Worksheet Functions 1 October 7th 05 12:44 AM
single text cells combines in new text cell toad32 Excel Discussion (Misc queries) 2 June 7th 05 01:17 PM


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