Sub 泓()
Application.ScreenUpdating = False
Dim C_str$, Cell0 As Range
Dim p As Shape
Set My = Worksheets("sheet1")
For Each p In My.Shapes
If Not Application.Intersect(p.TopLeftCell, Range("A:C")) Is Nothing Then p.Delete
Next
C_str = "A2:C" & Cells.Find("*", , , , 1, 2).Row
With Range(C_str)
Set c = .Find("●", , xlValues, xlWhole)
If Not c Is Nothing Then
Set Cell0 = c
fAdd = c.Address
Set c = .FindNext(c)
Do
myLine Cell0, c
Set Cell0 = c
Set c = .FindNext(c)
Loop While c.Address <> fAdd And Not c Is Nothing
End If
End With
Application.ScreenUpdating = True
End Sub
Sub myLine(Cel0 As Range, Cel1)
x0 = Cel0.Left + Cel0.Width / 2
y0 = Cel0.Top + Cel0.Height / 2
x1 = Cel1.Left + Cel1.Width / 2
y1 = Cel1.Top + Cel1.Height / 2
ActiveSheet.Shapes.AddLine(x0, y0, x1, y1).Line.ForeColor.SchemeColor = 64
End Sub
有谁能帮我翻译这段EXCEL VBA代码,我要每一句话的意思哦,谢谢高手帮忙
温馨提示:答案为网友推荐,仅供参考
第1个回答 2014-11-10
这个最好去excel home去求助,那里很多大师