View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_435_] joel[_435_] is offline
external usenet poster
 
Posts: 1
Default code to make a block arrow point from cell A to cell B


The origin or a shape is the upper left corner. when placing them on a
worksheet the problem is the rows and columns on the sheet can change
size but the shapes don't change size at the same time. Also each row
can have a diferent height and every column can be a different width.
So you must adjust the size of the coluns and rows before you change the
position and size of a shape.


I only briefly looked at you code. I aggree that you want to center
the arrows vertically by Getting the height and dividing by 2 to find
the cnet oer the the shape and the of the verticle area where you are
placing the shape on the workbook.


I don't think you want to do the same with the horizontal position but
it may work. Yo have to realize there is a border around the cells that
have a small dimension. When you place a shape at the left or top
position of a cell it will sit ontop or the border line around the
cells. So you want to make the shape a little smaller than the cells
distances.

You will see that if you use the code below the LeftSide and RightSide
give the same position. Yo uprobably want to have a little space
between the two expecially if you have a visible border around your
cells.


Dim RightSide As Single
Dim LeftSide As Single
RightSide = Range("B2").Left + Range("B2").Width
LeftSide = Range("C2").Left


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=165603

Microsoft Office Help