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 .Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y .Show End With End Sub
MP
"Line" a écrit dans le message de news:
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec la cellule active???
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
.Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y
.Show
End With
End Sub
MP
"Line" <Line@discussions.microsoft.com> a écrit dans le message de news:
F67D5C7D-7C0D-4812-8D73-385D173A7A34@microsoft.com...
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec
la cellule active???
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 .Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y .Show End With End Sub
MP
"Line" a écrit dans le message de news:
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec la cellule active???
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 ..Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y ..Show End With End Sub
MP
"Line" a écrit dans le message de news:
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec la cellule active???
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
..Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y
..Show
End With
End Sub
MP
"Line" <Line@discussions.microsoft.com> a écrit dans le message de news:
F67D5C7D-7C0D-4812-8D73-385D173A7A34@microsoft.com...
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec
la cellule active???
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 ..Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y ..Show End With End Sub
MP
"Line" a écrit dans le message de news:
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec la cellule active???
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 ..Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y ..Show End With End Sub
MP
"Line" a écrit dans le message de news:
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec la cellule active???
Bonjour, j'ai ceci dans une feuile, comment puis-je appliquer le code donné plus haut pour que sur le clic droit mon userform s'ouvre à proximité de la cellule active?
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
UserForm1.Show
Cancel = True
End Sub
Line a écrit le 04/04/2006 à 01h18 :
Merci beaucoup Michel!!! Et Merci aussi pour le UserForm
transparent trouvé chez Misange. Très pratique.
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
..Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y
..Show
End With
End Sub
MP
"Line" a écrit dans le
message de news:
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec
la cellule active???
Bonjour,
j'ai ceci dans une feuile, comment puis-je appliquer le code donné plus haut pour que sur le clic droit mon userform s'ouvre à proximité de la cellule active?
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
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 ..Top = ActiveWindow.PointsToScreenPixelsY(ActiveCell.Top * y) * 1 / y ..Show End With End Sub
MP
"Line" a écrit dans le message de news:
Bonjour ou bonsoir tout le monde
Est-il possible de faire coincider la position d'un UserForm avec la cellule active???
Bonjour, j'ai ceci dans une feuile, comment puis-je appliquer le code donné plus haut pour que sur le clic droit mon userform s'ouvre à proximité de la cellule active?
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)