Dim dic_xl As new Dictionary(Of String, String)
Dim dic_kc As new Dictionary(Of String ,String)
For Each c2 As Col In Forms("AA").Controls("table2").Table.Cols
If c2.Caption.Contains("销售数量_") And c2.Caption.Contains("店仓名称") = False Then
Dim v = c2.Caption.Replace("销售数量_","")
dic_xl.add(v, c2.name)
End If
If c2.Caption.Contains("可用库存_") And c2.Caption.Contains("店仓名称") = False Then
Dim v = c2.Caption.Replace("可用库存_","")
dic_kc.add(v, c2.name)
End If
Next
For Each r2 As Row In Forms("AA").Controls("table2").Table.Rows
Dim count1 As Integer = 0
Dim count2 As Integer = 0
For Each key As String In dic_xl.Keys
If r2(dic_xl(key)) > 0 Then '
count1 += 1
If r2(dic_kc(key)) = 0 Then
count2 += 1
End If
End If
Next
If count1 > 0 Then
r2("断码率") = count2 / count1
else
r2("断码率") = nothing
end if
Next