PC Review


Reply
Thread Tools Rate Thread

Compass Heading drawing from an angles list

 
 
=?Utf-8?B?TWFoaWV1eA==?=
Guest
Posts: n/a
 
      24th Jun 2007
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
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      24th Jun 2007
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" <(E-Mail Removed)> wrote in message
news:C60A24F8-94DA-4C17-8980-(E-Mail Removed)...
> 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



 
Reply With Quote
 
=?Utf-8?B?TWFoaWV1eA==?=
Guest
Posts: n/a
 
      24th Jun 2007
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" <(E-Mail Removed)> wrote in message
> news:C60A24F8-94DA-4C17-8980-(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
Peter T
Guest
Posts: n/a
 
      24th Jun 2007
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" <(E-Mail Removed)> wrote in message
news:7C37678C-A3FA-4DB7-BAAB-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> > news:C60A24F8-94DA-4C17-8980-(E-Mail Removed)...
> > > 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

> >
> >
> >



 
Reply With Quote
 
John
Guest
Posts: n/a
 
      24th Jun 2007
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
news:(E-Mail Removed)...
>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" <(E-Mail Removed)> wrote in message
> news:7C37678C-A3FA-4DB7-BAAB-(E-Mail Removed)...
>> 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" <(E-Mail Removed)> wrote in message
>> > news:C60A24F8-94DA-4C17-8980-(E-Mail Removed)...
>> > > 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
>> >
>> >
>> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drawing a text border around chapter heading =?Utf-8?B?WmFuY291dGg=?= Microsoft Word Document Management 1 24th Jan 2007 10:34 AM
Re: List into column heading =?Utf-8?B?TWF4?= Microsoft Excel Misc 0 8th Jan 2007 11:32 AM
Drawing a compass Hugh Janus Microsoft VB .NET 8 21st Aug 2006 10:53 PM
List Box Heading jack-e Microsoft ASP .NET 1 12th Feb 2006 09:36 PM
List Box Heading =?Utf-8?B?am0xMDA=?= Microsoft Word Document Management 1 30th Oct 2004 03:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:19 AM.