+ Reply to Thread
Results 1 to 3 of 3

two font sizes in chart title

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    two font sizes in chart title

    I currently have this string in my macro script.

    With Worksheets("Graphs").ChartObjects(1).Chart
            .HasTitle = True
            .ChartTitle.Text = "Sample Text" & Chr(10) & "Text Sample2"
        End With
    But i would like the first part in size 18 font and the second part in size 14 font.
    Is this possible?

    thanks in advance

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: two font sizes in chart title

    Sub x()
    
        Dim strTitle As String
        Dim strSubTitle As String
        
        strTitle = "Sample Text"
        strSubTitle = Chr(10) & "Text Sample2"
        
        With Worksheets("Graphs").ChartObjects(1).Chart
            .HasTitle = True
            .ChartTitle.Text = strTitle & strSubTitle
            .ChartTitle.Characters(Len(strTitle) + 1, Len(strSubTitle)).Font.Size = 14
            .ChartTitle.Characters(1, Len(strTitle)).Font.Size = 18
        End With
    End Sub
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    03-27-2012
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: two font sizes in chart title

    perfect, thank you!

+ 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