您可以使用 LinQ 完成此操作:
Module Module1
Public myValues As List(Of CellValue)
Sub Main()
myValues = New List(Of CellValue)
myValues.Add(New CellValue With {.RowID = 1, .ColumnID = 1, .Value = "Hello 1"})
myValues.Add(New CellValue With {.RowID = 2, .ColumnID = 2, .Value = "Hello 2"})
myValues.Add(New CellValue With {.RowID = 3, .ColumnID = 3, .Value = "Hello 3"})
myValues.Add(New CellValue With {.RowID = 4, .ColumnID = 4, .Value = "Hello 4"})
myValues.Add(New CellValue With {.RowID = 5, .ColumnID = 5, .Value = "Hello 5"})
Dim x As CellValue = (From val As CellValue In myValues Where val.RowID = 1 Select val).FirstOrDefault()
End Sub
End Module
Class CellValue
Public RowID, ColumnID As Integer
Public Value As Object
End Class
祝你好运!