Arrow Direction

CalvinGraham

Board Regular
Joined
Jan 27, 2010
Messages
67
So I've got two tables and I wanted to have an arrow between them, showing the flow between them of which rows the user has selected

Anyway, I can set the arrow shape's heights/position easily enough with .top and .height but I can't see how to tell it which way to face. Ie is it: / or \

The code that Excel records has .msoFlipVertical but you need to know the existing property to know whether to flip it over. I could delete and redraw each time or maybe store it hidden in the left/right property but these seem overcomplicated. Is there not a simple property?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Have a play with this:-
Code:
MsgBox ActiveSheet.Shapes("Autoshape 1").HorizontalFlip > -1
ActiveSheet.Shapes("Autoshape 1").Flip msoFlipHorizontal
 
Upvote 0
Great, thanks. For anyone else stumbling along this thread, I entered this to adjust the line:
Code:
With ActiveSheet.Shapes("Line_TableToTable")
        .Top = IIf(StartHeight < EndHeight, StartHeight, EndHeight)
        .Height = IIf(StartHeight < EndHeight, EndHeight - StartHeight, StartHeight - EndHeight)
        'the arrow has to face the right way, ie / or \
        'check what way it should face and flip it if necessary
        '.VerticalFlip = true means the shape has been flipped and is currently a / type arrow
        If StartHeight > EndHeight Then
            'it should be /
            If .VerticalFlip = False Then
                .Flip msoFlipVertical
            End If
        Else
            'it should be \
            If .VerticalFlip = True Then
               .Flip msoFlipVertical
            End If
        End If
    End With
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,308
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top