Consulting

Results 1 to 2 of 2

Thread: How to change the forecolor in charts?

  1. #1

    How to change the forecolor in charts?

    Here is my code:

    Sub MakroP()
    
        ActiveSheet.Shapes.AddChart.Select
        ActiveChart.ChartType = xlXYScatter
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(1).name = "=""Losses"""
        ActiveChart.SeriesCollection(1).XValues = "=IR!$D$6:$D$50005"
        ActiveChart.SeriesCollection(1).Values = "=IR!$C$6:$C$50005"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(2).name = "=""UU"""
        ActiveChart.SeriesCollection(2).XValues = "=IR!$O$6"
        ActiveChart.SeriesCollection(2).Values = "=IR!$N$6"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(3).name = "=""DD"""
        ActiveChart.SeriesCollection(3).XValues = "=IR!$O$7"
        ActiveChart.SeriesCollection(3).Values = "=IRl!$N$7"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(4).name = "=""ALL"""
        ActiveChart.SeriesCollection(4).XValues = "=IR!$O$13"
        ActiveChart.SeriesCollection(4).Values = "=IR!$N$13"
        ActiveChart.SeriesCollection.NewSeries
        ActiveChart.SeriesCollection(5).name = "=""ALE"""
        ActiveChart.SeriesCollection(5).XValues = "=IR!$O$12"
        ActiveChart.SeriesCollection(5).Values = "=IR!$N$12"
        ActiveChart.SeriesCollection(1).Select    'Losses form changing
        With Selection
            .MarkerStyle = 2
            .MarkerSize = 7
        End With
        Selection.MarkerStyle = 8
        ActiveChart.SeriesCollection(3).Select                                            '  form changing
        With Selection
            .MarkerStyle = 3
            .MarkerSize = 7
        End With
        Selection.MarkerStyle = 8
        ActiveChart.SeriesCollection(2).Select                                              '  Form changing
        With Selection
            .MarkerStyle = 1
            .MarkerSize = 7
        End With
        Selection.MarkerStyle = 8
        ActiveChart.SeriesCollection(4).Select                                ' form changing
        With Selection
            .MarkerStyle = -4168
            .MarkerSize = 7
        End With
        Selection.MarkerStyle = 8
        With Selection.Format.Fill                                                 'color changing
            .Visible = msoTrue
            .ForeColor.RGB = RGB(255, 255, 255)
            .Solid
        End With
    With Selection.Format.Fill
            .Visible = msoTrue
            .ForeColor.RGB = RGB(255, 255, 255)
            .Transparency = 0
            .Solid
        End With
        ActiveChart.SeriesCollection(5).Select    ' form changing
        With Selection
            .MarkerStyle = 5
            .MarkerSize = 7
        End With
    Selection.MarkerStyle = 8
    With Selection.Format.Fill               ' color changing
            .Visible = msoTrue
            .ForeColor.RGB = RGB(250, 50, 0)
            .Transparency = 0
            .Solid
        End With
    End Sub
    I cannot Change the Color. Have someone an idea??
    Last edited by Aussiebear; 12-11-2015 at 02:47 AM. Reason: Added hash tag to submitted code

  2. #2
    ok I solved it. You have to delete the .Solid. Then it works.

Posting Permissions

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