The following code changes each line series from 2.25 point to .75 point. It should also change the color of each line to a dark green but it doesn't. The chart stays multicolored unless I run it a second time. Why does it not change the line thickness and color all at the same time? I don't want to have to call this module twice to get it to do the job.
Sub x() Dim objSeries As Series With ActiveChart For Each objSeries In .SeriesCollection With objSeries.Format.Line .Transparency = 0 .Weight = 0.75 .ForeColor.RGB = RGB(40, 56, 24) End With Next End With End Sub
I had the same experience on the first time through but when I changed the line back and ran the macro again, it changed both. It also changed both when I stepped through the function. I'm not sure what is going on.
ChemistB
My 2¢
Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)
This change works for me,
Sub x() Dim objSeries As Series With ActiveChart For Each objSeries In .SeriesCollection With objSeries.Format.Line .Style = msoLineSingle .Transparency = 0 .ForeColor.RGB = RGB(40, 56, 24) .Weight = 0.75 End With Next End With End Sub
Excellent! Thank you very much!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks