+ Reply to Thread
Results 1 to 2 of 2

Display value of all items in Listview

Hybrid View

  1. #1
    Registered User
    Join Date
    07-15-2015
    Location
    Indonesia
    MS-Off Ver
    2013
    Posts
    30

    Display value of all items in Listview

    Hello,

    I just want to display all items in my listiview (not selected, loop all items and display it)

    I have the below code

    For i = 0 To frm_Main.lv_Main.ListItems.Count - 1
        
                MsgBox frm_Main.lv_Main.ListItems(i).Text
                MsgBox frm_Main.lv_Main.ListItems(i).SubItems(1)
                MsgBox frm_Main.lv_Main.ListItems(i).SubItems(2)
                MsgBox frm_Main.lv_Main.ListItems(i).SubItems(3)
    
            Next
    But I'm getting the below error code
    Index out of bounds
    Thanks in advance

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Display value of all items in Listview

    Can't you use a count of the subitems?
    If posting code please use code tags, see here.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Listview items to export to excel
    By puuts in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2014, 04:32 AM
  2. [SOLVED] Excel: Display combobox as listview subitem
    By ChrisVBA in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-07-2014, 10:03 AM
  3. Display multi line text in sub item of a listview .
    By priya06manohar@gmail in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2014, 02:43 PM
  4. [SOLVED] Problem with Listview display in userform
    By Jonno1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-11-2014, 08:10 AM
  5. How to display item in listview
    By siobeh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-03-2014, 01:14 PM
  6. [SOLVED] count of unique listview items
    By Kiran2012 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 01-08-2013, 07:43 AM
  7. [SOLVED] Printing ListView Control Items into WorkSheet
    By contaminated in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2012, 09:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1