• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Private Sub ListView1_Click(): How to get column value from the row

inddon

Member
Hello There,

I have a ListView created in a UserForm. I would like to have the following when the user click on the ListView row:

1. To get the value of 3rd column

Tried the below code, in vain:

Code:
Private Sub ListViewMaster_Click()
'MsgBox ListViewMaster.ListItems(1).SubItems(1)
MsgBox ListViewMaster.FindItem(3).ListSubItems  'ListViewMaster.ListItems(1)
End Sub


Could you please advise how could I achieve this?

Thanks
Don
 
Pls upload the sample file.


Hello Deepak,

The solution which you proposed is related to ListBox. This one is for a ListView

Just made up the below solution, if you know the below could be improved in a easier way, please let me know:

Code:
ListViewMaster.SelectedItem.ListSubItems.Item(1).Text



Regards
Don
 
Back
Top