Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

2 different formats of text in a single cell?

3 views
Skip to first unread message

mopgcw

unread,
Sep 23, 2008, 3:31:01 PM9/23/08
to
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

Rick Rothstein

unread,
Sep 23, 2008, 3:39:49 PM9/23/08
to
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" <mop...@discussions.microsoft.com> wrote in message
news:52471F62-C823-40A1...@microsoft.com...

mopgcw

unread,
Sep 23, 2008, 4:46:31 PM9/23/08
to
Thanks, how would I format part of a text constant?

David Biddulph

unread,
Sep 23, 2008, 4:56:45 PM9/23/08
to
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" <mop...@discussions.microsoft.com> wrote in message

news:EF44314B-728D-47CF...@microsoft.com...

Rick Rothstein

unread,
Sep 23, 2008, 5:12:25 PM9/23/08
to
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
news:x4idnZrrTfeMxUTV...@bt.com...

mopgcw

unread,
Sep 23, 2008, 5:28:03 PM9/23/08
to
David & Rick

THANKS, this was VERY helpful.

That's why this is such a great forum.

Take care,
George

0 new messages