+ Reply to Thread
Results 1 to 8 of 8

Set angle for ticklabel on axis

Hybrid View

  1. #1
    Registered User
    Join Date
    01-06-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2007
    Posts
    4

    Set angle for ticklabel on axis

    I build excel chart via VBA and need to know what is the property to set angle for ticklabel on X axis. I tried to record a macro but didn't get any code recorded.

    Thanks in advance.
    Last edited by jnevada; 01-06-2009 at 01:02 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
    Activesheet.chartobjects(1).Chart.Axes(xlCategory).TickLabels.Orientation = 22
    values between +/- 90
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    01-06-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2007
    Posts
    4
    Quote Originally Posted by Andy Pope View Post
    Activesheet.chartobjects(1).Chart.Axes(xlCategory).TickLabels.Orientation = 22
    values between +/- 90
    Andy,

    Thank you so so much. It works very well. I'm making xlLineMarkers using VBA. One thing I notice is that the join part of the line is a sharp angle. Is there any way to make it smoother like a curve?

    Very appreciate.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
        With ActiveSheet.ChartObjects(1).Chart
            With .SeriesCollection(1)
                .Smooth = True
            End With
        End With

  5. #5
    Registered User
    Join Date
    01-06-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2007
    Posts
    4
    Quote Originally Posted by Andy Pope View Post
        With ActiveSheet.ChartObjects(1).Chart
            With .SeriesCollection(1)
                .Smooth = True
            End With
        End With
    Thanks, Andy.

    But I got error on this one:

    
    Dim aveSeries As Series
        
    For Each aveSeries In objChart.SeriesCollection
            aveSeries.Delete
    Next aveSeries
    
    Set aveSeries = objChart.SeriesCollection.NewSeries
        
    With aveSeries
                .Formula = "=Series(Chart_data!A2,Chart_data!$A$3:$A$15, Chart_Data!$E$3:E$15, 1)"
                .Smooth = True  'error, "this property is not valid for this chart  type"
    End With
    Do you know why?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481
    no idea. can you post example workbook.
    When I create a test file the code bombs on the .Formula line

+ 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