Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If I have a range in excel that has angles in degrees in one column and
lengths in the next. ANGLE LENGTH 90 5 225 6 90 5 How could i draw a line with segments that have those dimensions (assuming north is up) (Those dimension should end up drawing something like a Z) Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way:
Public Sub DrawLines() ' cdConvToRads = Pi / 180 Const cdConvToRads As Double = 0.0174532925199433 Const cdScaleFactor As Double = 2 Dim rCell As Range Dim dAngle As Double Dim dLen As Double Dim dStartX As Double Dim dStartY As Double Dim dEndX As Double Dim dEndY As Double dStartX = 100 dStartY = 100 With ActiveSheet For Each rCell In Range(.Cells(2, 1), _ .Cells(.Rows.Count, 1).End(xlUp)) With rCell dAngle = .Value * cdConvToRads dLen = .Offset(0, 1).Value * cdScaleFactor End With dEndX = dStartX + dLen * Sin(dAngle) dEndY = dStartY - dLen * Cos(dAngle) .Shapes.AddLine dStartX, dStartY, dEndX, dEndY dStartX = dEndX dStartY = dEndY Next rCell End With End Sub In article , choice wrote: If I have a range in excel that has angles in degrees in one column and lengths in the next. ANGLE LENGTH 90 5 225 6 90 5 How could i draw a line with segments that have those dimensions (assuming north is up) (Those dimension should end up drawing something like a Z) Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Connecting lines disappear | Excel Discussion (Misc queries) | |||
Connecting to FTP | Excel Programming | |||
Leader Lines Connecting Chart to Box | Excel Discussion (Misc queries) | |||
Leader Lines Connecting Chart to Box | Charts and Charting in Excel | |||
Need Help Connecting To DB | Excel Programming |