Private Function placementRange(Obj As Object)
If Obj Is Nothing Then Exit Function
Dim Z#, EcX#, L1#, T1#, C#, R#, Vr As Range, Hx#, Wx#, Ok As Boolean, Op&, PtoPx#, i&
With ActiveWindow
PtoPx = (.ActivePane.PointsToScreenPixelsX(72) - .ActivePane.PointsToScreenPixelsX(0)) / 72 'coeff point to pixel
Op = Int(Val(Mid(Application.OperatingSystem, InStrRev(Application.OperatingSystem, " ") + 1))) 'number version system
'exit si la cellule injecté n'est pas vible a l'ecran
For i = 1 To .Panes.Count: Ok = IIf(Not Intersect(.Panes(i).VisibleRange, Obj) Is Nothing, True, Ok): Next
If Ok = False Then Beep: MsgBox " cette cellule n'est pas visible a l'ecran": Exit Function
Z = (ActiveWindow.Zoom / 100): Set Vr = .VisibleRange 'Coeff zoom , rangevisible partie mobile
EcX = 4 And Op = 6 And Int(Val(Application.Version)) < 16 'ecart cadre
L1 = (.ActivePane.PointsToScreenPixelsX(Int(Obj.left)) / PtoPx) * Z + EcX 'placement partie mobile
T1 = .ActivePane.PointsToScreenPixelsY(Int(Obj.top)) / PtoPx * Z + EcX
With .Panes(1).VisibleRange: C = .Cells(.Cells.Count).Column: R = .Cells(.Cells.Count).Row: End With 'limite splitrow et splitcolumn
If .SplitRow > 0 Then 'placement dans le splitrow
If Obj.Row < R + 1 And .ScrollRow > R Then T1 = ((.ActivePane.PointsToScreenPixelsY(Vr.Cells(1).top) / PtoPx) * Z) - (Range(Obj, Cells(R, 1)).Height * Z) + EcX
End If
If .SplitColumn > 0 Then 'placement dans le splitcolumn
If Obj.Column < C + 1 And .ScrollColumn > C Then L1 = ((.ActivePane.PointsToScreenPixelsX(Vr.Cells(1).left) / PtoPx) * Z) - (Range(Obj, Cells(1, C)).Width * Z) + EcX
End If
End With
'option de placement :
Wx = (Obj.Width / 2) * Z * Px
Hx = (Obj.Height / 2) * Z * Py
L1 = L1 + (Wx)
T1 = T1 + (Hx)
With Me: .left = L1: .top = T1: End With
End Function