Thread: Text Formating
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Text Formating

Not too clear on what you need but maybe you can adapt this?

Sub Highlight_Word()
Dim rng As Range
Dim Cell As Range
Dim start_str As Integer
On Error GoTo endit
myword = InputBox("Enter the search string ")
If myword = "" Then Exit Sub
Mylen = Len(myword)
Set rng = Selection
With rng
.Font.FontStyle = "regular"
.Value = "My response is " & myword & ". Hope you like it"
start_str = InStr(.Value, myword)
If start_str Then
.Characters(start_str, Mylen).Font.FontStyle = "bold italic"
End If
End With
endit:
End Sub


Gord Dibben MS Excel MVP

On Sun, 24 May 2009 08:02:01 -0700, Rahul Gupta
wrote:

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