Private Sub UserForm_Activate()
Set Rng = [D5]
Hwnduf = ExecuteExcel4Macro("CALL(""user32"",""GetActiveWindow"",""JCC"")") 'handle fenetre active
ExecuteExcel4Macro ("CALL(""user32"",""SetWindowLongA"",""JJJJJ""," & Hwnduf & ", " & -20 & ", " & &H101C0080 & ")")
ExecuteExcel4Macro ("CALL(""user32"",""DrawMenuBar"",""JJ"", " & Hwnduf & ")")
With ActiveWindow.ActivePane
PtPx = (.PointsToScreenPixelsX(72) - .PointsToScreenPixelsX(0)) / 72 'coeff pixel
If Not Rng Is Nothing Then x = .PointsToScreenPixelsX(Rng.Left): y = .PointsToScreenPixelsY(Rng.Top)
End With
With Me
.Left = (x / PtPx * ActiveWindow.Zoom / 100) ' + 3 'chez moi
.Top = (y / PtPx * ActiveWindow.Zoom / 100) '+ 3 'chez moi
End With
End Sub