I'm trying to use the ListBox.ControlTipText to display text from a very long entry in a Listbox.
I've looked at previous versions of Loops just like this and they seem to work just fine - This one, however, does not work at all.
Here are a couple versions I've tried - the row selected in the Listbox is row 6
What happens is the Loop never connects to the 'Then' statement -
However, if I manually place the code on that line - the ControlTipText displays the correct text.
Clearly I'm not seeing something ??
Thank You!!!
Code:
Private Sub LstRePubQs_Click()
Dim i As Integer
Dim str As String
For i = 0 To Me.LstRePubQs.ListCount - 1
If (Me.LstRePubQs.Selected(i) = True) Then
str = Me.LstRePubQs.Column(1, i)
Exit For
End If
Next
Me.LstRePubQs.ControlTipText = str
Debug.Print str
End Sub
Code:
Private Sub LstRePubQs_Click()
Dim i As Integer
Dim str As String
For i = 0 To Me.LstRePubQs.ListCount - 1
If Me.LstRePubQs.Selected(i) Then
str = Me.LstRePubQs.Column(1, i)
Exit For
End If
Next
Me.LstRePubQs.ControlTipText = str
Debug.Print str
End Sub