Salut le forum
Positionner le Userform selon la cellule active, (Réf Michel Perron)
Option Explicit
Private Declare Function GetDC& Lib _
"user32.dll" (ByVal hwnd&)
Private Declare Function GetDeviceCaps& _
Lib "gdi32" (ByVal hDC&, ByVal nIndex&)
Sub UserFormAlign()
' 1 inch = 72 points for usually 96 or 120 dpi
Dim x#, y#, w#, h#
x = GetDeviceCaps(GetDC(0), 88) / 72
y = GetDeviceCaps(GetDC(0), 90) / 72
With UserForm1
.StartUpPosition = 0
.Left = (ActiveWindow.PointsToScreenPixelsX(ActiveCell.Left * x) * 1 / x) + ActiveCell.Width
.Top = (ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y) + ActiveCell.Height
.Show
End With
End Sub
Mytå