Dim rrr() As Integer = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17}
Dim g = rrr.Select(Function(value, index) New With {value, index}) _
.GroupBy(Function(x) x.index \ 5) _
.Select(Function(group) group.Select(Function(x) x.value))
For i = 0 To g.Count - 1
MsgBox(g(i).Sum)
Next
'For Each r In g
' MsgBox(r.Sum)
'Next
MsgBox(rrr.Sum)
Dim g = rrr.Select(Function(value, index) New With {value, index}) _
.GroupBy(Function(x) x.index \ 5) _
.Select(Function(group) group.Select(Function(x) x.value))
For i = 0 To g.Count - 1
MsgBox(g(i).Sum)
Next
'For Each r In g
' MsgBox(r.Sum)
'Next
MsgBox(rrr.Sum)
