Results 1 to 9 of 9

Remove Chart Area Border - Where in Code is it Added?

Threaded View

  1. #1
    Registered User
    Join Date
    10-30-2009
    Location
    UK
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    60

    Question Remove Chart Area Border - Where in Code is it Added?

    I have very little knowledge of editing Visual Basic and I'm a little stuck on something: somewhere within this code (below) I am getting a chart area border showing on my graphs - but I don't want a border and cant find the coding to remove it. (I previously had Excel 03 and found this easier as I would record a macro and look at the coding to see where I needed to edit, but I can't seem to do that in 07


    Could someone point out how I could remove the border please (do I need to attach a sample workbook for this?)

    Many thanks in advance.



     'grab name for new chart and title
        aName = ws.Cells(iRow, 1)
        'delete old chart
        Sheets(aName).Delete
        'make new chart
        Charts.Add
        ActiveSheet.Move after:=Sheets(ActiveWorkbook.Sheets.Count)
        ActiveChart.ChartType = xlBarClustered
        ActiveChart.SetSourceData _
              Source:=ws.Range(ws.Cells(4 * iRow - 11, 7), _
              ws.Cells(4 * iRow - 9, 9)), PlotBy:=xlRows
        ActiveChart.Location Where:=xlLocationAsNewSheet, _
             Name:=aName
        With ActiveChart
            .Name = aName
            .HasTitle = True
            .ChartTitle.Characters.Text = "Average Times - 1st January to 31st March 2011" & Chr(10) & Chr(10) & Chr(10) & "Consultant- " & aName & Chr(10) & Chr(10) & "Sample Size - Adv: " & Sheets("Adv & TC Ave").Cells(iRow, 5) & Chr(10) & "Sample Size - TC: " & Sheets("Adv & TC Ave").Cells(iRow, 4) & Chr(10)
            .Axes(xlCategory, xlPrimary).HasTitle = False
            .Axes(xlValue, xlPrimary).HasTitle = False
            End With
        
        ActiveChart.HasLegend = True
        ActiveChart.Legend.Select
        ActiveChart.Legend.Font.Size = 12
        Selection.Position = xlTop
        ActiveChart.ApplyDataLabels AutoText:=True, LegendKey:=False, _
            HasLeaderLines:=False, ShowSeriesName:=False, ShowCategoryName:=False, _
            ShowValue:=True, ShowPercentage:=False, ShowBubbleSize:=False
        ActiveChart.SeriesCollection(2).DataLabels.Select
        Selection.NumberFormat = "0"
        ActiveChart.ApplyDataLabels Type:=xlDataLabelsShowValue, LegendKey:=False
        ActiveChart.SeriesCollection(1).Select
        With ActiveChart.ChartGroups(1)
            .Overlap = -10
            .GapWidth = 100
            .HasSeriesLines = False
            .VaryByCategories = False
        End With
        
        ActiveChart.PlotArea.Select
        With Selection.Border
            .ColorIndex = 16
            .Weight = xlThin
            .LineStyle = xlContinuous
        End With
        Selection.Fill.OneColorGradient Style:=msoGradientHorizontal, Variant:=3, _
            Degree:=1
        With Selection
            .Fill.Visible = True
            .Fill.ForeColor.SchemeColor = 24
        End With
        ActiveChart.SeriesCollection(1).Select
        With Selection.Border
            .Weight = xlThin
            .LineStyle = xlAutomatic
        End With
        Selection.Shadow = False
        Selection.InvertIfNegative = False
        Selection.Fill.Patterned Pattern:=msoPatternLightUpwardDiagonal
        With Selection
            .Fill.Visible = True
            .Fill.ForeColor.SchemeColor = 55
            .Fill.BackColor.SchemeColor = 2
        ActiveChart.SeriesCollection(2).Select
        With Selection.Border
            .Weight = xlThin
            .LineStyle = xlAutomatic
        End With
        Selection.Shadow = False
        Selection.InvertIfNegative = False
        With Selection.Interior
            .ColorIndex = 55
            .Pattern = xlSolid
        End With
        With ActiveChart
            .Axes(xlCategory, xlPrimary).HasTitle = False
            .Axes(xlValue, xlPrimary).HasTitle = True
            .Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = _
            "Average Time In Minutes"
        End With
        ActiveChart.Axes(xlValue).MajorGridlines.Select
        With Selection.Border
            .ColorIndex = 48
            .Weight = xlHairline
            .LineStyle = xlContinuous
        End With
        With ActiveChart.SeriesCollection(2).DataLabels.Select
        Selection.NumberFormat = "0"
        ActiveChart.SeriesCollection(1).DataLabels.Select
        Selection.NumberFormat = "0"
        End With
        
        ActiveChart.Axes(xlValue).Select
        With ActiveChart.Axes(xlValue)
            .MinimumScaleIsAuto = 0
            .MaximumScale = 60
            .MinorUnitIsAuto = True
            .MajorUnitIsAuto = True
            .Crosses = xlAutomatic
            .ReversePlotOrder = False
            .ScaleType = xlLinear
            .DisplayUnit = xlNone
        End With
        ActiveChart.ChartArea.Select
        ActiveChart.Deselect
        
        End With
        
      
        
        ActiveChart.SeriesCollection(2).DataLabels.Select
        Selection.AutoScaleFont = False
        With Selection.Font
            .Name = "Calibri"
            .Size = 14
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
            .Background = xlAutomatic
        End With
        ActiveChart.SeriesCollection(1).DataLabels.Select
        Selection.AutoScaleFont = False
        With Selection.Font
            .Name = "Calibri"
            .Size = 14
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
            .Background = xlAutomatic
        End With
        ActiveChart.Axes(xlCategory).Select
        Selection.TickLabels.AutoScaleFont = True
        With Selection.TickLabels.Font
            .Name = "Calibri"
            .Size = 14
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
            .Background = xlAutomatic
        End With
        ActiveChart.Axes(xlValue).AxisTitle.Select
        Selection.AutoScaleFont = False
        With Selection.Font
            .Name = "Calibri"
            .Size = 14
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
            .Background = xlAutomatic
        End With
        ActiveChart.Axes(xlValue).Select
        Selection.TickLabels.AutoScaleFont = True
        With Selection.TickLabels.Font
            .Name = "Calibri"
            .Size = 14
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
            .Background = xlAutomatic
        End With
        ActiveChart.ChartTitle.Select
        Selection.AutoScaleFont = False
        With Selection.Font
            .Name = "Calibri"
            .Size = 14
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
            .Background = xlAutomatic
        End With
        ActiveChart.Legend.Select
        Selection.AutoScaleFont = False
        With Selection.Font
            .Name = "Calibri"
            .Size = 14
            .Strikethrough = False
            .Superscript = False
            .Subscript = False
            .OutlineFont = False
            .Shadow = False
            .Underline = xlUnderlineStyleNone
            .ColorIndex = xlAutomatic
            .Background = xlAutomatic
        End With
        
        
            
        iRow = iRow + 1
    Loop Until ws.Cells(iRow, 1) = ""
    Application.DisplayAlerts = True
    
    
    
    End Sub
    Last edited by Janc; 06-13-2011 at 03:31 AM.

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