For Each r As Row In Tables("物料清单B").rows
Dim s As String = r("物料")
Do While r.Parent IsNot Nothing
r = r.Parent
s = r("物料") & ">" & s
Loop
Dim dr As Row = Tables("表K").AddNew
If s.Split(">").Length > 0 Then
For i As Integer = 0 To s.Split(">").Length - 1
dr("第" & i + 1) = s.Split(">")(i)
Next
End If
Next
With Tables("表K")
.MergeMode = MergeModeEnum.Free
.MergeCols.Clear()
.MergeCols.Add("第1")
.MergeCols.Add("第2")
.MergeCols.Add("第3")
.MergeCols.Add("第4")
.MergeCols.Add("第5")
.MergeCols.Add("第6")
.MergeCols.Add("第7")
.MergeCols.Add("第8")
.MergeCols.Add("第9")
.MergeCols.Add("第10")
.MergeSort = "第1,第2,第3,第4,第5,第6,第7,第8,第9,第10"
.AllowMerge = True
End With
'请问老师红框的行如何避免生成!谢谢!