Dim t As Table = Tables("表A") Dim r1 As Row = t.Rows(0) Dim r2 As Row = t.Rows(1) Dim ls As new List(Of String) For i As Integer = r2.Index To t.Rows.count-1 If ls.Contains(t.Rows(i)("第一列")) = False Then ls.add(t.Rows(i)("第一列")) End If If ls.count >= 4 Then Exit For End If Next r2("第二列") = String.Join(",", ls.ToArray) If ls.Contains(r1("第一列")) Then r2("第三列") = "中" Else r2("第三列") = "未开出" End If
|