--
Dim dictCol As new Dictionary(of String,Integer)
Dim r As Row = Tables("表B").Rows(0)
For i As Integer = 1 To Tables("表B").Cols.Count - 1
dictCol.Add(r(i),i)
Next
Dim dictRow As new Dictionary(of String,Integer)
For i As Integer = 1 To Tables("表B").Rows.Count - 1
dictRow.Add(Tables("表B").Rows(i)("第一列"),i)
Next
For Each r1 As Row In Tables("表A").Rows
If r1.IsNull("编码") = False
Dim ss() As String = r1("编码").split("/")
If ss.length = 1 Then
Tables("表B").Rows(dictRow(ss(0)))(1) = r1("数量")
Else
Tables("表B").Rows(dictRow(ss(1)))(dictCol(ss(0))) = r1("数量")
End If
End If
Next