Automate line drawing in Excel

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
 
J

Joel

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
 
N

Neil Perry

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top