Jan 16 2022 06:43 AM
Bonjour,
Je veux inclure une forme sur ma feuille Excel.
Je crée une macro ce qui donne :
ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 1346.8220472441, _
411.2288188976, 1432.6270866142, 552.3304724409).Select
Selection.ShapeRange.Line.EndArrowheadStyle = msoArrowheadTriangle
Range("BB25").Select
End Sub
La fonction attend des paramètres "single".
Function AddConnector(Type As MsoConnectorType, BeginX As Single, BeginY As Single, EndX As Single, EndY As Single) As Shape
Membre de Excel.Shapes
Question : quelle fonction permet de passer de l'adresse de la cellule où je veux pointer la flèche aux chiffres "single" qu'attend la fonction addconnector?
Impossible de trouver la réponse dans toutes les aides que j'ai consultées
Jan 16 2022 07:15 AM
SolutionPar exemple:
Sub Macro1()
Dim X1 As Single
Dim Y1 As Single
Dim X2 As Single
Dim Y2 As Single
Dim shp As Shape
With Range("B2")
X1 = .Left
Y1 = .Top
End With
With Range("D4")
X2 = .Left + .Width
Y2 = .Top + .Height
End With
Set shp = ActiveSheet.Shapes.AddConnector(msoConnectorStraight, X1, Y1, X2, Y2)
shp.Line.EndArrowheadStyle = msoArrowheadTriangle
End Sub
Résultat:
Jan 16 2022 08:21 AM
Oct 17 2022 11:45 PM
Oct 18 2022 01:31 AM
Jan 16 2022 07:15 AM
SolutionPar exemple:
Sub Macro1()
Dim X1 As Single
Dim Y1 As Single
Dim X2 As Single
Dim Y2 As Single
Dim shp As Shape
With Range("B2")
X1 = .Left
Y1 = .Top
End With
With Range("D4")
X2 = .Left + .Width
Y2 = .Top + .Height
End With
Set shp = ActiveSheet.Shapes.AddConnector(msoConnectorStraight, X1, Y1, X2, Y2)
shp.Line.EndArrowheadStyle = msoArrowheadTriangle
End Sub
Résultat: