Dim r As Row
Dim slit() As String = {"A","B","C","D"}
Dim idx As Integer = 0
For Each s As String In DataTables("军工布置表").GetValues("军工布置")
r = Tables("军工位置布置统计表").AddNew
r("军工布置") = s
Dim lst As List(of String) = DataTables("军工布置表").GetValues("位置代码","军工布置='" & s & "'")
Dim s1 As String = lst(0)
Dim s2 As String = lst(0)
For ias Integer = 1 To lst.Count - 1
If cint(s1)+1 <> cint(lst(i)) Then
s2 = s2 & "--" & s1
r(slit(idx) & "号码") = s2
s2 = lst(i)
idx += 1
End If
s1 = lst(i)
Next
Next