Option Explicit
Sub testUF()
Dim PaN As Pane, PtsToPx#, shap As Shape
PtsToPx = (4 / 3) 'utilisez la méthode que vous voulez
Set shap = ActiveSheet.Shapes(1)
Set PaN = GetPaneOfObject2(shap)
With UserForm1
.Show 0
.Move PaN.PointsToScreenPixelsX(shap.Left) / PtsToPx, _
PaN.PointsToScreenPixelsY(shap.Top) / PtsToPx
End With
End Sub
Function GetPaneOfObject2(obj As Object) As Pane
Dim X&
With ActiveWindow
X = 1
If .SplitColumn > 0 Then If obj.Left > Cells(1, .SplitColumn).Offset(, 1).Left Then X = X + 1
If .SplitRow > 0 Then If obj.Top > Cells(.SplitRow, 1).Offset(1).Top Then X = X + 1
If .Panes.Count = 4 Then
If obj.Top > Cells(.SplitRow, 1).Offset(1).Top Then X = X + 1
End If
Set GetPaneOfObject2 = .Panes(X)
End With
End Function