|
本帖最后由 wangg913 于 2021-10-14 11:15 编辑
数据表保留一个图表。
- Option Base 1
- Sub Rose()
- Dim sht As Worksheet
- Dim cht As Chart
- Dim arr, crr(), I%, J%, N%, A%
- Set sht = Worksheets("Sheet1")
- Set cht = sht.ChartObjects(1).Chart
- Do While cht.SeriesCollection.Count
- cht.SeriesCollection(1).Delete
- Loop
- arr = sht.Range("A1").CurrentRegion.Columns(2)
- A = UBound(arr) - 1
- N = Int(360 / A)
- For I = 1 To A
- ReDim crr(N * A)
- For J = 1 To N
- crr(I * N - N + J) = arr(I + 1, 1)
- Next
- With cht.SeriesCollection.NewSeries
- .ChartType = xlRadarFilled
- .Values = crr
- End With
- Next
- cht.SetElement msoElementPrimaryValueAxisShow
- cht.SetElement msoElementDataLabelNone
- End Sub
复制代码
|
|