+ Reply to Thread
Results 1 to 2 of 2

TextBox Font

  1. #1
    Soniya
    Guest

    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


  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1