|
重寫一個//每行只跑一次
Sub myLine1()
Dim xR As Range, A As Range, B As Range, N&, x1, x2, y1, y2
ActiveSheet.Lines.Delete
For k = 0 To 1
c% = 14 ^ k: N = 0
For Each xR In Cells(1, c).CurrentRegion.Rows
If xR.Row < 2 Then GoTo x01
Set A = xR.Find("*")
x1 = A.Left + A.Width / 2
y1 = A.Top + A.Height / 2
If N > 0 Then
With ActiveSheet.Shapes.AddLine(x1, y1, x2, y2).Line
.DashStyle = msoLineSolid
.Weight = 1.25
.ForeColor.RGB = Range("M1").Interior.Color
End With
End If
N = 1: Set B = A: x2 = x1: y2 = y1
x01: Next
Next k
End Sub
|
|