|
本帖最后由 Datous 于 2019-4-15 19:24 编辑
- Private Sub CommandButton1_Click()
- Dim rngStd As Range
- Dim A As Byte, B As Byte
- Set rngStd = Me.Range("A1").CurrentRegion
- With Me.Shapes("图表 1").Chart.SeriesCollection(1)
- .Format.Fill.Solid
- For A = 1 To .Points.Count
- For B = 1 To rngStd.Columns.Count / 2
- If .Values()(A) <= rngStd.Cells(2, B * 2 - 1) And .Values()(A) >= rngStd.Cells(2, B * 2) Then
- .Points(A).Format.Fill.ForeColor.RGB = rngStd.Cells(3, B * 2 - 1).Interior.Color
- Exit For
- End If
- Next B
- Next A
- End With
- End Sub
复制代码 |
|