Automate line drawing in Excel

  • Thread starter Thread starter Neil Perry
  • Start date Start date
N

Neil Perry

Hello -

Is it possible to automate drawing lines on my worksheet?

I have a Project Master Schedule where I am manually drawing in a timeline
and need to show backspike delays etc. This takes a long time, so was
wondering if this is possible. I include other information on this sheet, so
doing it on a graph would not work for me.

Does anyone have any links to examples of such a technique?

Many thanks,
Neil
 
Try this code

With Sheets("Sheet2")
MyTop = .Range("B4").Top
MyLeft = .Range("B4").Left
MyBottom = .Range("D10").Top + .Range("D10").Height
MyRight = .Range("D10").Left + .Range("D10").Width

Set myLine = .Shapes.AddLine(MyLeft, MyTop, MyRight, MyBottom)
End With
 
Joel -

Thank you for your post - I have tried your code and it worked.

I will use this to produce my line.

Thanks again
Neil
 
Back
Top