Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Build macro to draw lines between multiple points

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 Templat
A B C D..
1
2
3
4
...

Points of Intersectio
Origination: Destination
A10 B
C7 D1

Macro
Draw line between points of intersection on a chart

  #2   Report Post  
Posted to microsoft.public.excel.programming
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to draw trend lines through only certain data points akh2103 Charts and Charting in Excel 3 April 3rd 23 11:09 AM
VBA to draw lines of SPC Daniel Charts and Charting in Excel 4 July 31st 07 08:44 PM
How to Draw a chart line connecting 2 points in the middle of the series KathyC Charts and Charting in Excel 3 November 28th 06 12:30 AM
Draw line between two points using data on the spreedsheet Woody Canuck Excel Discussion (Misc queries) 1 October 9th 05 01:21 PM
How to build build a macro that automatically imports PedroPeso Excel Programming 1 December 26th 03 08:14 PM


All times are GMT +1. The time now is 11:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"