Sub test4(obj As Object)
Dim Z#, EcX#, L1#, T1#, C#, R#, Vr As Range
With ActiveWindow
Z = (ActiveWindow.Zoom / 100): EcX = 4: Set Vr = .VisibleRange
L1 = (.ActivePane.PointsToScreenPixelsX(Int(obj.Left)) / PtoPx) * Z + EcX
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
If .SplitRow > 0 Then
If obj.Row < R + 1 And .ScrollRow > R Then T1 = ((.ActivePane.PointsToScreenPixelsY(Vr.Cells(1).Top) / PtoPx) * Z) - (Range(obj, Cells(R, obj.Column)).Height * Z) + EcX
End If
If .SplitColumn > 0 Then
If obj.Column < C + 1 And .ScrollColumn > C Then L1 = ((.ActivePane.PointsToScreenPixelsX(Vr.Cells(1).Left) / PtoPx) * Z) - (Range(obj, Cells(obj.Row, C)).Width * Z) + EcX
End If
End With
With UserForm1
.Show 0: .Left = L1: .Top = T1
End With
End Sub
Private Function PtoPx()
With ActiveWindow.ActivePane:
PtoPx = (.PointsToScreenPixelsX(Cells.Width) - .PointsToScreenPixelsX(0)) / Cells.Width
End With
End Function