ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   TextBox Font (https://www.excelbanter.com/excel-programming/346816-textbox-font.html)

Soniya[_4_]

TextBox Font
 
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


Leith Ross[_348_]

TextBox Font
 

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


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=489011



All times are GMT +1. The time now is 09:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com