Thread: Text Formating
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Text Formating

You cannot format the text itself (that is, within the code)... what you
need to do is insert the text into a cell and then apply the formatting you
want to the characters you want. Here is a code example to give you the idea
of what I mean...

Sub Test()
Dim Answer As String
Answer = InputBox("Tell me something...")
With Range("F5")
.Value = "My Response is " & Answer & ". Hope you like it."
With .Characters(16, Len(Answer)).Font
.Bold = True
.Italic = True
End With
End With
End Sub

--
Rick (MVP - Excel)


"Rahul Gupta" wrote in message
...
Hello There,

I have created a Macro and i want it to return formated text to be
appended
to a text.

For Eg. If my macro Return "I Love You" then i need it to be formated.

="My Response is " & <Bold<Italicsmacro Name</bold</Italics & ". Hope
you like it".

How can i do this?

Regards