Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Moving Shapes | Excel Discussion (Misc queries) | |||
Moving shapes around - XL2007 bug? | Excel Programming | |||
inserted shapes keep moving | Excel Discussion (Misc queries) | |||
Moving Shapes within VBA | Excel Programming | |||
Arrow Keys Moving Window Frame instead of Moving Between Cells | Excel Discussion (Misc queries) |