fork download
  1. Sub ガントチャート描画2()
  2. Dim c As Range
  3. Dim org As Range
  4. Dim dst As Range
  5.  
  6. For Each c In Range("D8:D20")
  7. If c.Value <> "" Then
  8. Call MyFind(c.Text, org)
  9. Call MyFind(c.Offset(0, 1).Text, dst)
  10.  
  11. With ActiveSheet.Shapes.AddLine(org.Left + 0, _
  12. c.Top + 7, dst.Left + 0, c.Top + 7).Line
  13. .EndArrowheadStyle = msoArrowheadTriangle
  14. .ForeColor.RGB = RGB(0, 0, 128)
  15. .Weight = 3
  16. End With
  17. End If
  18. Next
  19. End Sub
  20.  
  21. Private Sub MyFind(ByVal src As String, ByRef rng As Range)
  22. Dim r As Range
  23. Set rng = Nothing
  24. For Each r In Range("F5:AJ5")
  25. If r.Text = src Then
  26. Set rng = r
  27. Exit Sub
  28. End If
  29. Next
  30. End Sub
  31.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty