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

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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,214,998
Messages
6,122,643
Members
449,093
Latest member
Ahmad123098

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