I found this from a Google search and I need the VB.NET equivalent to Martin Liss' code
Code:
Dim lngIndex As Long
    Dim lngTot As Long
    
    For lngIndex = 1 To lv.ListItems.Count
        lngTot = lngTot + lv.ListItems(lngIndex).SubItems(1)
    Next
    
    MsgBox lngTot
I have
vb.net Code:
  1. Dim intRptTotal As Integer = 0
  2. For i As Integer = 1 To ListView1.Items.Count
  3.       intRptTotal = intRptTotal + CInt(ListView1.Items(i).SubItems(1))
  4. Next
But, I'm getting the error
Quote Originally Posted by Option Strict
Value of type 'System.Windows.Forms.ListViewItem.ListViewSubItem' can not be converted to 'Integer'
Basically, I need to total up a number column in a ListView.