|
楼主 |
发表于 2022-8-23 01:43
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
用形状比用图表要省事,计算一下各个数据和最大值的比例,设置圆的大小,然后对齐居中即可
- Sub Main()
- Application.Calculation = xlCalculationManual
- With Sheet1
- .Calculate
- ar = .Range("b2:g7").Value
- t = .Shapes("Leval1").Top
- h = .Shapes("Leval1").Height
- For i = 3 To 6
- b = ar(i, 6)
- h0 = h * b
- .Shapes(i - 1).Height = h0
- .Shapes(i - 1).Width = h0
- .Shapes(i - 1).Top = t + h - h0
- Next
- With .Shapes.Range(Array("Leval1", "Leval2", "Leval3", "Leval4", "Leval5"))
- .Align msoAlignCenters, msoFalse
- .Align msoAlignBottoms, msoFalse
- .IncrementTop Sheet1.Range("J3").Top - Sheet1.Shapes("Leval1").Top
- .IncrementLeft Sheet1.Range("J3").Left - Sheet1.Shapes("Leval1").Left
- End With
- End With
- Application.Calculation = xlCalculationAutomatic
- End Sub
复制代码
|
评分
-
1
查看全部评分
-
|