LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Compass Heading drawing from an angles list

Hello Mahieux,

Building on Peter's rotation advice, you could have a go with the following
code:

Sub AddCompassShapes()
Dim shp As Shape
Dim iRow As Integer
Dim iCol As Integer
Dim wks As Worksheet

Set wks = ActiveSheet
iRow = ActiveCell.Row
iCol = ActiveCell.Column

For x = 0 To 9
Set shp = wks.Shapes.AddShape(msoShapeUpArrow, _
Cells(iRow + x, iCol + 1).Left + _
((Cells(iRow + x, iCol + 2).Left - _
Cells(iRow + x, iCol + 1).Left) / 2), _
Cells(iRow + x, iCol + 1).Top, _
Cells(iRow + x, iCol + 1).Width / 3, _
Cells(iRow + x, iCol + 1).Height)
If Not Cells(iRow + x, iCol).Value = "" Then
shp.Rotation = Cells(iRow + x, iCol).Value
End If
Next x

End Sub

It's probably not very efficient but hopefully gives you the idea.
Additions to the code might include naming the shapes as you lay them down
so that you can refer to them later on. For example you could add the
follow line before the If statement line:

shp.Name = wks.Name & "-" & Cells(iRow + x, iCol).Address

This would give you the ability to get a reference to a cell's respective
arrow shape.

Anyway, hope that's helpful.

Best regards

John


"Peter T" <peter_t@discussions wrote in message
...
I don't really follow what you are trying to do.

FWIW, revolving a compass style line is not as complicated as I implied.
Start by drawing the line vertically from bottom to top, such that its mid
point is on the axis. Then use the Rotation method.

Regards,
Peter T

"Mahieux" wrote in message
...
I can survive with a preset shape group of circle and line ;-)
but the whole thing has to be in a macro still and I have 1200 GPS

points....
for which each need a visu picture

"Peter T" wrote:

ActiveSheet.Shapes(1).Rotation = Range("A1")

If you mean revolve or set the angle of a line(arrow) around a central
point, like a compass, it's a lot more complicated.

Regards,
Peter T


"Mahieux" wrote in message
...
Hi
Is there any simple way to rotate a basic shape based on the value in

a
column :
say : the value contains 0 or 360 = heading North , the value shows

90 =
heading East and so on. It so simple ......apparently but I did not

find
any
hook in Excel allowing to do this (aside of macros)
If you get any light on this ?
Thks in advance









 
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
Compass degrees formatting Stephen Excel Discussion (Misc queries) 1 September 23rd 07 05:50 PM
How to count the data in ranges for compass points WM[_2_] Excel Worksheet Functions 2 August 1st 07 04:16 AM
Download Merlin Data Compass 2 _mubashir Excel Programming 0 April 4th 07 01:29 PM
List into column heading Isa Excel Discussion (Misc queries) 2 January 8th 07 11:39 AM
Add Column Heading to List Supe Excel Discussion (Misc queries) 0 October 16th 06 04:22 PM


All times are GMT +1. The time now is 02:07 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"