|
本帖最后由 剑指E 于 2023-2-19 00:24 编辑
- Sub lx()
- Dim rgs As Range, c As Range, ar, i&, br
- br = Array("a2:l", "n2:u")
- With Sheet1
- For j = 0 To UBound(br)
- Set rgs = Intersect(.UsedRange, .Range(br(j) & Rows.Count))
- ReDim ar(1 To rgs.Rows.Count, 1 To 2)
- For Each c In rgs
- If c <> "" Then
- i = i + 1
- ar(i, 2) = c.Top + c.Height / 2
- ar(i, 1) = c.Left + c.Width / 2
- End If
- Next
- For i = 1 To UBound(ar) - 1
- If ar(i + 1, 1) <> "" Then .Shapes.AddConnector(1, ar(i, 1), ar(i, 2), ar(i + 1, 1), ar(i + 1, 2)).Select Else Exit For
- Next
- i = 0
- Next
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|