#If VBA7 Then
Private Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As LongPtr, ByVal wMsg As Long, ByVal wParam As LongPtr, lParam As Any) As LongPtr
#Else
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
#End If
Private Sub CommandButton2_Click()
Dim Item As Object
'Sélectionner la ligne
Me.ListView1.SelectedItem = Me.ListView1.ListItems(CInt(Me.TextBox1.value))
' Simuler un clic de bouton gauche de souris (down et up) dans la ListView
SendMessage Me.ListView1.hWnd, &H201, 0, 0
SendMessage Me.ListView1.hWnd, &H202, 0, 0
End Sub