TextBox Font

S

Soniya

Hi All,

I have the following:
Sheets("Sheet1").Shapes("Text Box 1").Select
Selection.Characters.Text =
Sheets("Sheet1").Cells(1, 1) & Chr(10) & Chr(10) &
Sheets("Sheet1").Cells(2, 1)

cell(1,1) font is "Thoma" (English Language)
cell(2,1) font is "ML-TTKarthika" (Malayalam Language)

How could I get to the text box the same font type of cell 1 and cell 2
using code?
If possible with all formatting in cell 1 and 2

Thanks
 
L

Leith Ross

Hello Soniya.

You can not change the font of a Forms Toolbar TextBox. By using a
Control Toolbox TextBox (Visual Basic Toolbar) you can control most of
the font properties.

CODE EXAMPLE:

With Worksheets("Sheet1").OLEObjects("TextBox1").Object.Font
..Name = "ML-TTKarthika"
..Size = 8
..Bold = False
..Italic = True
..Underline = False
..Strikethrough = False
End With

TO CHANGE THE FONT COLOR TO BLUE:

Worksheets("Sheet1").OLEObjects("TextBox1").Object.ForeColor = vbBlue

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top