I am trying to draw a line between two cells and this is my try
Code: Select all
Sub Connect(r1 As Range, r2 As Range)
With ActiveSheet.Shapes
.AddLine r1.Left + r1.Width / 2, r1.top + r1.Height / 2, r2.Left + r2.Width / 2, r2.top + r2.Height / 2
.Name = "MyLine"
End With
End Sub