作者:别喷我我还小_216 | 来源:互联网 | 2023-05-19 11:23
Ihavecreatedthermometerchartswhicharecoloredbasedonarange(red-poor,yellow-average,
I have created thermometer charts which are colored based on a range (red - poor, yellow - average, green - good) from cells in my sheet. That is, the chart references the color of the cell to determine fill color. However, when printed in black and white the red and green are difficult to distinguish. I do not want to abandon the stoplight coloring because it is intuitive for my audience.
我已经创建了温度计图表,这些温度计图表根据我的工作表中的单元格(红色 - 差,黄色 - 平均,绿色 - 好)进行着色。也就是说,图表引用单元格的颜色来确定填充颜色。但是,当以黑白打印时,红色和绿色难以区分。我不想放弃红绿灯着色,因为它对我的观众来说很直观。
I am trying to figure out how to get the chart fill to reflect the pattern in the cells in addition to the color. My current syntax (for color fill) is below.
我试图弄清楚如何获得图表填充以反映细胞中除了颜色之外的模式。我目前的语法(用于颜色填充)如下。
Sub ColorByValueSMICAUpdate()
Dim rPatterns As Range
Dim iPattern As Long
Dim vPatterns As Variant
Dim iPoint As Long
Dim vValues As Variant
Dim rValue As Range
Set rPatterns = ActiveSheet.Range("P5:P11")
vPatterns = rPatterns.Value
With ActiveChart.SeriesCollection(1)
vValues = .Values
For iPoint = 1 To UBound(vValues)
For iPattern = 1 To UBound(vPatterns)
If vValues(iPoint) <= vPatterns(iPattern, 1) Then
.Points(iPoint).Format.Fill.ForeColor.RGB = _
rPatterns.Cells(iPattern, 1).Interior.Color
Exit For
End If
Next
Next
End With
End Sub
Thank you!
谢谢!
1 个解决方案