自动绘制直线进度横道图 需要写VBA球球我就不知道了Private Type pointapi
x As Single
y As Single
End Type
Sub drawlines()
Dim i As Integer, j As Integer, n As Integer, p() As pointapi
While ActiveSheet.Shapes.Count > 0
ActiveSheet.Shapes(1).Delete
Wend
n = Range("f65536").End(xlUp).Row
ReDim p(2 To n)
For i = 2 To n
j = 5
Do
j = j + 1
Loop Until Cells(i, j).Font.ColorIndex = 3
p(i).x = 8 + j * Cells(i, j).Width
p(i).y = Cells(i, 1).Top + 0.5 * Cells(i, 1).Height
If i > 2 Then ActiveSheet.Shapes.AddLine p(i - 1).x, p(i - 1).y, p(i).x, p(i).y
Next
End Sub
没有必要这么麻烦 数据表大把
不会啊
标签:excel,3d,走势图