LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default draw shape based on cell values

I am trying to draw a series of simple polylines based on cells containing
values calculated from the original user input.

There are up to 20 polylines to be drawn. Each has five set points which are
found in cells Sn:Zn of sheet "Drawing Calcs" where n is the row number which
depends on which polyline is being drawn (the first polylines coordinates are
on row 3)

I have the following code which I hoped would do this but doesn't.

Sub draw()
Dim sides As Integer
Dim i As Integer
i = 0
sides = Worksheets("Drawing Calcs").Range("B24").Value
Dim cilldwg(5, 2) As Single
Do
i = i + 1
Worksheets("Drawing Calcs").Select
cilldwg(1, 1) = Cells(i + 2, 19).Value
cilldwg(1, 2) = Cells(i + 2, 20).Value
cilldwg(2, 1) = Cells(i + 2, 21).Value
cilldwg(2, 2) = Cells(i + 2, 22).Value
cilldwg(3, 1) = Cells(i + 2, 23).Value
cilldwg(3, 2) = Cells(i + 2, 24).Value
cilldwg(4, 1) = Cells(i + 2, 25).Value
cilldwg(4, 2) = Cells(i + 2, 26).Value
cilldwg(5, 1) = Cells(i + 2, 19).Value
cilldwg(5, 2) = Cells(i + 2, 20).Value
Worksheets("Drawing").Select
Worksheets("Drawing").Shapes.AddPolyline cilldwg
Loop Until i = sides
End Sub

This brings up "Run-time error '1004'; application-defined or object-defined
error."

Excel help is not much use... can anyone tell me what I need to change?
 
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 can I rotate objects in draw without changing shape? oldgunnersmate New Users to Excel 1 October 17th 08 07:21 PM
Excel 2002: How to draw an oval shape outline to the worksheet? Mr. Low Excel Discussion (Misc queries) 9 September 22nd 08 09:06 PM
If I draw a shape in Excel (say a triangle), can I colour it? David Burne Jones Excel Worksheet Functions 4 August 4th 08 08:44 PM
How can you draw a shape when the values change each time?? man57 New Users to Excel 1 April 17th 06 09:30 AM
can excel draw a shape based on values entered in cells Milo Excel Worksheet Functions 1 April 6th 05 01:36 AM


All times are GMT +1. The time now is 02:49 PM.

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

About Us

"It's about Microsoft Excel"