ListBox index question ...
To All,
I have a ListBox on a UserForm that works fine ... what I'm trying to
do now is use the .ListIndex in conjunction with offset ... so that I
can assign the adjacent cells contents to a Label's caption:
LblDescription.Caption
I'm stuck trying to convert this index number to an address - with the
hope to then use that address and "offset" 1 cell right ...
Could someone guide me on the correct procedure ...
Thanks,
JimP
''''''''''''''''''''''''''''''''''''''''''
Private Sub ListBox1_Click()
Dim sIndexName As String: sIndexName = ""
' ITEM
With Me.ListBox1
If .ListIndex -1 Then
sIndexName = .List(.ListIndex)
End If
End With
' followingline is a problem ...
' LblDescription.Caption = ActiveSheet.Range(sIndexName).Address. _
' Offset(0, 1).Value
End Sub
|