Consulting

Results 1 to 3 of 3

Thread: Fullseriescollection - replacing Excel 2013 VBA with Excel 2010 - help!

  1. #1
    VBAX Newbie
    Joined
    Oct 2013
    Posts
    2
    Location

    Fullseriescollection - replacing Excel 2013 VBA with Excel 2010 - help!

    Hi All,

    I'm having some VBA code compatibility issues. I put together some code in Excel 2013 that uses the "fullseriescollection" object, however I have now discovered that the code wont work correctly in eXcel 2010. The code is meant to reformat a chart based on the max value of one of the ranges (The code hides one of the ranges that would make the scale too big as it is 10x larger than the next closest value).

    Would I be OK to just replace with "seriescollection"? The code I am using is:

    Sub pivotFormat()
    
    
    
    
    Dim maxrange As Double
    
    
    
    
    maxrange = Application.WorksheetFunction.Max(Range("k14:k26"))
    
    
    
    
        ActiveSheet.ChartObjects("Chart 3").Activate
        ActiveChart.FullSeriesCollection(3).ChartType = xlLine
        ActiveChart.FullSeriesCollection(3).AxisGroup = 2
        ActiveChart.FullSeriesCollection(2).ChartType = xlLine
        ActiveChart.FullSeriesCollection(1).ChartType = xlLine
        ActiveChart.FullSeriesCollection(2).AxisGroup = 2
        ActiveChart.FullSeriesCollection(1).AxisGroup = 2
        ActiveChart.Axes(xlValue, xlSecondary).Select
        ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = maxrange * 1.1
        ActiveChart.Axes(xlValue, xlSecondary).MinimumScale = 0
        ActiveChart.Axes(xlValue).Select
        ActiveChart.Axes(xlValue).MaximumScaleIsAuto = True
        ActiveChart.FullSeriesCollection(1).Select
        Selection.Format.Line.Visible = msoFalse
        ActiveChart.FullSeriesCollection(2).Select
        Selection.Format.Line.Visible = msoFalse
        ActiveChart.FullSeriesCollection(5).Select
        Selection.Format.Line.Visible = msoFalse
        ActiveChart.FullSeriesCollection(5).AxisGroup = 2
        ActiveChart.FullSeriesCollection(6).Select
        Selection.Format.Line.Visible = msoFalse
        ActiveChart.FullSeriesCollection(6).AxisGroup = 2
        
    End Sub
    Thanks for any advice!

  2. #2
    VBAX Master Aflatoon's Avatar
    Joined
    Sep 2009
    Location
    UK
    Posts
    1,720
    Location
    It appears so from a quick read through.
    Be as you wish to seem

  3. #3
    VBAX Newbie
    Joined
    Oct 2013
    Posts
    2
    Location
    Just tried and seems to have worked, thanks!

Posting Permissions

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