Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Macro for moving arrow shapes

I have an arrow shape pointing upwards. I want to move it's head with
the other end fixed. Just like a speedometer.If I use shapes
(0).rotation(45), i get the rotation, but it adjusts the whole arrow.
not the head.
Is there any way? Any help would be appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro for moving arrow shapes

You need two lines. One always fixed that is verticle and one that rotates
with the arrow.

"Yajiv" wrote:

I have an arrow shape pointing upwards. I want to move it's head with
the other end fixed. Just like a speedometer.If I use shapes
(0).rotation(45), i get the rotation, but it adjusts the whole arrow.
not the head.
Is there any way? Any help would be appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Macro for moving arrow shapes

tricky this
rotation moves the entire arrow. so we calculate how far the bottom moved,
and move it back.

so we know where the bottom of the arrow is (x1,y1) which is the TOP +
HEIGHT if the arrow srarts veritcally
when we rotate we know the new position, so we can calculate the new bottom
position (x2,y2)
we need to move the TOP (X2 - X1, Y2-Y1) which will shift the shape so that
the bottom part of the arrow returns to its original position

"Yajiv" wrote in message
...
I have an arrow shape pointing upwards. I want to move it's head with
the other end fixed. Just like a speedometer.If I use shapes
(0).rotation(45), i get the rotation, but it adjusts the whole arrow.
not the head.
Is there any way? Any help would be appreciated.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Macro for moving arrow shapes

Hi,

Group your arrow with a rectangle. The rectangle should be twice the height
of the arrow. Then make the width the same as the height.
Now select both rectangle and arrow. Align Top and Centers. Format rectangle
to have no fill or border. Group the 2 shapes.

Now when you rotate the grouped shape it will rotate around the center,
which is where the base of the arrow sits.

Cheers
Andy
--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"Yajiv" wrote in message
...
I have an arrow shape pointing upwards. I want to move it's head with
the other end fixed. Just like a speedometer.If I use shapes
(0).rotation(45), i get the rotation, but it adjusts the whole arrow.
not the head.
Is there any way? Any help would be appreciated.


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
Moving Shapes Preschool Mike Excel Discussion (Misc queries) 3 April 16th 10 10:45 PM
Moving shapes around - XL2007 bug? Mike Excel Programming 1 April 14th 09 05:45 PM
inserted shapes keep moving Stephid707 Excel Discussion (Misc queries) 1 February 16th 09 05:37 PM
Moving Shapes within VBA Juan Schwartz Excel Programming 3 August 20th 07 09:12 PM
Arrow Keys Moving Window Frame instead of Moving Between Cells nemmex Excel Discussion (Misc queries) 2 April 9th 07 09:08 AM


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