Changing direction the arrow points when I draw it in with VBA.

gxm204

New Member
Joined
Nov 20, 2015
Messages
29
Hello, I am using VBA to animate movement between two points on a graph. I am also drawing an arrow to illustrate the movement. This macro works fine... I used the recorder for it, so there is probably some stuff to tidy.

My concern is that it is drawing the arrow pointed the opposite direction that I want. What command can I use in VBA to set the arrow to go the direction I want?

Here is my code. Thanks for taking a look.

Code:
Sub Between()
'
' Between Macro
'


'Dim time1, time2
    
    Range("E6").Select
    ActiveCell.FormulaR1C1 = "1000000"


time1 = Now
time2 = Now + TimeValue("0:00:01")
    Do Until time1 >= time2
        DoEvents
        time1 = Now()
    Loop
    


    ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 422, 202.5, 423, 223.5). _
        Select
        Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
    With Selection.ShapeRange.Line
        .Visible = msoTrue
        .Weight = 1
        .Visible = msoTrue
        .ForeColor.ObjectThemeColor = msoThemeColorBackground1
        .ForeColor.TintAndShade = 0
        .ForeColor.Brightness = -0.25
        .Transparency = 0
    End With
End Sub
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi

You are using a property named .EndArrowheadStyle.
I don't have time to look into it now, but the first thing I'd do is to check if there a corresponding property for the other end, like .StartArrowheadStyle or BeginArrowheadStyle.
 
Upvote 0
Yes. There is a property -- .Flip msoFlipVertical that made it point the other way.
Thank you!
 
Upvote 0

Forum statistics

Threads
1,215,510
Messages
6,125,241
Members
449,217
Latest member
Trystel

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