View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Build macro to draw lines between multiple points

Something like

Dim nStart1 As Double, nStart2 As Double
Dim nEnd1 As Double, nEnd2 As Double
Dim rng1 As Range
Dim rng2 As Range

Set rng1 = Range("A10")
Set rng2 = Range("B6")

nStart1 = rng1.Left + rng1.Width
nStart2 = rng1.Top
nEnd1 = rng2.Left + rng2.Width
nEnd2 = rng2.Top

ActiveSheet.Shapes.AddLine(nStart1, nStart2, nEnd1, nEnd2).Select

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Angie" wrote in message
...
I would like utlize the standard excel spreadsheet to represent a location

grid in a machine shop for example. I would then like to be able to define
movement of a product by specifying two differnet locations on the
spreadhseet and then use a macro to draw all the lines between those points.
See below

Grid - Use standard Excel as Template
A B C D...
1
2
3
4
...

Points of Intersection
Origination: Destination:
A10 B6
C7 D15


Macro:
Draw line between points of intersection on a chart.