TextBox Font

  • Thread starter Thread starter Soniya
  • Start date Start date
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
 
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
 
Back
Top