Help needed
Hello,
I have assigned a macro to a shape in Excel 2007. The VBA code look for the name of this shape in an Excel data sheet and using a vlookup function pulls out the information in the adjacent column.
The problem I am having is I want to italicize and bold some words in the message that is showing in the userform. I searched a lot on the internet but couldn't find any solution. Please let me know how can I italicize and bold some words in the message in the userform.
Thanks
Shape Text Colors
Shapes have a property called TextFrame
and TextFrame has a property called Characters
With Sheet1.Shapes("Text Box 11")
.TextFrame.Characters.Caption = "How Now Brown Cow"
.TextFrame.Characters(Start:=1, Length:=3).Font.ColorIndex = FontColorIndex.Red
.TextFrame.Characters(Start:=5, Length:=3).Font.FontStyle = "bold italic"
End With
This code snippit adds text and changes colors
It may be enough of an example to get you started
Bold Italic
Try this:
[code]
Private Sub cmdBoldItalic_Click()
Range("a2").Select
Selection.Font.Bold = True
Selection.Font.Italic = True
End Sub
[/code]
It works for me.