You need to put this code in the list box's Click event:
Code:
Private Sub List1_Click()
If List1.ListIndex = List1.ListCount - 1 Then
MsgBox "This is the last item"
Else
MsgBox "This is not the last item"
End If
End Sub
The ListIndex will show you the integer index value for the item 0 through ListCount-1.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.