【发布时间】:2013-10-06 00:42:49
【问题描述】:
我的宏记录器中可能存在错误,因为当我尝试记录 xlvalues 轴中的颜色变化时,没有记录下来。 我需要做的是设置具有 2 种不同灰度和不同透明度的 渐变 径向颜色。
我正在使用此代码来设置我的图表:
ActiveSheet.Shapes.AddChart.Select
With ActiveChart
.ChartType = xlRadar
.SetSourceData Source:=Range(StartCell, StopCell) ' Those contain a range of interesting data
With .SeriesCollection(1)
.Name = "=""Line 1"""
.Format.Line.Weight = 1.5
End With
With .SeriesCollection(2)
.Name = "=""Line 2"""
.Format.Line.Weight = 1.5
.Format.Line.DashStyle = msoLineDash
End With
.SetElement (msoElementChartTitleAboveChart)
.ChartTitle.Text = Left(Cells(StartCell.Row, 1).Text, 2) & "." & Mid(Cells(StartCell.Row, 1).Text, 3, 1) & " GHz"
With .Axes(xlValue)
.TickLabels.NumberFormat = "# ""dB"""
.Border.ColorIndex = 3 ' <- This is yet to be modified
End With
End With
我该怎么做?我认为所有可以在 excel 中制作的东西,也可以在 vba 中以编程方式完成......
【问题讨论】:
-
与
this相关吗? -
不。
.Border.ColorIndex可以很好地更改颜色...只是我必须将其设置为灰色渐变而不是红色(= 3) -
尝试
15而不是3- 因为15 是灰色的 -
如果我想设置一个正常的颜色就可以了……但我真的需要这样的渐变:elliottback.com/wp/wp-content/excel-gradient-graph.png
-
您提供的链接显示了填充了灰色渐变的图表背景。这是你想做的吗?
标签: vba excel colors charts radar-chart