Consulting

Results 1 to 2 of 2

Thread: Delete some plot area

  1. #1
    VBAX Contributor
    Joined
    Apr 2012
    Posts
    107
    Location

    Delete some plot area

    Lw = Range("b2").End(xlDown).Row
      Range("A2:I" & Lw).Select
        Set cht1 = ActiveSheet.Shapes.AddChart
        cht1.Chart.ChartType = xlLineMarkers
        cht1.Chart.Location xlLocationAsNewSheet
    ActiveChart.ChartArea.Select
        ActiveChart.PlotArea.Select
        Dim ValuesArray(), SeriesValues As Variant
        Dim Ctr As Integer, TotCtr As Integer
        With ActiveChart
            For Each x In .SeriesCollection
                SeriesValues = x.Values
                ReDim Preserve ValuesArray(1 To TotCtr + UBound(SeriesValues))
                For Ctr = 1 To UBound(SeriesValues)
                    ValuesArray(Ctr + TotCtr) = SeriesValues(Ctr)
                Next
                TotCtr = TotCtr + UBound(SeriesValues)
            Next
            .Axes(xlValue).MinimumScaleIsAuto = True
            .Axes(xlValue).MaximumScaleIsAuto = True
            .Axes(xlValue).MinimumScale = Application.Min(ValuesArray)
            .Axes(xlValue).MaximumScale = Application.Max(ValuesArray)
            ActiveChart.FullSeriesCollection(5).Select
        ActiveChart.FullSeriesCollection(2).Delete
        ActiveChart.FullSeriesCollection(2).Delete
        ActiveChart.FullSeriesCollection(2).Delete
        ActiveChart.FullSeriesCollection(2).Delete
        ActiveChart.FullSeriesCollection(2).Delete
        ActiveChart.FullSeriesCollection(2).Delete
        ActiveChart.PlotArea.Select
        ActiveChart.FullSeriesCollection(2).Select
        ActiveChart.FullSeriesCollection(2).AxisGroup = 2
        ActiveChart.ChartArea.Select
        ActiveChart.FullSeriesCollection(2).Select
        ActiveChart.Legend.Select
        Selection.Delete
        Application.CommandBars("Format Object").Visible = False
    plse add code to the above code so that plot area lelow 30 to be deleted
    Attached Files Attached Files

  2. #2
    VBAX Contributor
    Joined
    Apr 2012
    Posts
    107
    Location
    SLOVED

Posting Permissions

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