Results 1 to 4 of 4

Multiple formats inside single text box (activex)

Threaded View

CodyMartin Multiple formats inside... 12-29-2008, 06:14 PM
Leith Ross Hello CodyMartin, A VBA... 12-29-2008, 06:54 PM
bhofsetz Cody, How is your textbox... 12-29-2008, 07:29 PM
CodyMartin I switched from an Active X... 12-30-2008, 11:02 AM
  1. #1
    Registered User
    Join Date
    12-23-2008
    Location
    Tulsa, Oklahoma
    MS-Off Ver
    2007
    Posts
    4

    Multiple formats inside single text box (activex)

    Hello again.

    I'm having trouble keeping the formatting correctly in a text box through VBA. I'm sure this is something simple, but I'm the intern that got stuck with trying to program for the break since they know I've taken classes on the subject. I've been able to figure out a lot, which I owe a great amount of thanks (THANK YOU!) to this forum and the handy search function. However, I couldn't find any pertinent information regarding this topic.

    End goal: To have the first word of a text box larger, underlined, and bolded.

    Problem: It only formats it Calibri at 24 point with no special formatting as indicated in the code.

    Worksheets("H&P Area Map Updated").Select
        Sheet6.txtMidCon.Activate
            With Sheet6.txtMidCon
                .Text = ""
                .Text = "Mid-Continent (" & Str(MCR) & " Rigs) " & MidCon
                With Selection.Characters(Start:=1, Length:=13).Font
                    .Name = "Calibri"
                    .Size = 40
                    .Underline = xlUnderlineStyleSingle
                    .FontStyle = "Bold"
                End With
                With Selection.Characters(Start:=14, Length:=1000).Font
                    .Name = "Calibri"
                    .Size = 24
                End With
            .BorderColor = RGB(113, 147, 255)
            .BorderStyle = fmBorderStyleSingle
            .WordWrap = True
            .MultiLine = True
            .AutoSize = False
            .Width = 425
            .Height = Len(MidCon)
            End With
    Thank you for looking,

    Cody Martin
    Last edited by CodyMartin; 12-30-2008 at 11:02 AM. Reason: Slight Edit of code

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