|
> SelecTion.ShapeRange.Line.EndArrowheadStyle = _
> mscArrowheadTriangle
↑これ動かないんですけど。
で、何となく↓こうなった。
Sub jiji()
Dim Cel As Range, Ans As Variant
For Each Cel In Range("A1:F1")
If Cel.Value <> "" Then
Ans = Application.Match(Cel.Value, Rows(3), 0)
If Not IsError(Ans) Then
Call bobo(Cel, Cells(3, Ans))
End If
End If
Next
End Sub
Sub bobo(Cel As Range, RG As Range)
Dim SttL As Double, SttT As Double
Dim EndL As Double, EndT As Double
SttL = Cel.Left + Cel.Width / 2
SttT = Cel.Offset(1).Top
EndL = RG.Left + RG.Width / 2
EndT = RG.Top
With ActiveSheet.Shapes.AddLine(SttL, SttT, EndL, EndT)
.Line.EndArrowheadStyle = msoArrowheadTriangle
End With
End Sub
|
|