'Editing the Format and Color of a Excel Line Chart with Excel Macro
I am trying to write a Macro in Excel that could help me to change the color and format of the lines in a chart and the marks on the line. Here is what I want to realize: a 3x3 chart in the Excel, each row is for the color of the Line, the frame color of the marks on the line, and the filling's color of the marks of the line.
I can change the colors and the other things of a line in a line chart now. However, I have met problems with the marks. I can't change the right colors, and the filling's color is always not the color I want. Here's my code, I have put the 3x3 chart of the RGB value from Q10 to S12.
Sub Makro1()
'
' Makro1 Makro
'
'
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(Cells(10, 17).Value, Cells(10, 18).Value, Cells(10, 19).Value)
.Weight = xlThin
.DashStyle = msoLineSolid
.Transparency = 0
End With
With Selection.Format.Fill
.Visible = msoTrue
.BackColor.RGB = RGB(Cells(11, 17).Value, Cells(11, 18).Value, Cells(11, 19).Value)
.Transparency = 0
.Solid
End With
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
