谢谢甜老师!是这样,
列名字是
销售数量_1,销售数量_2...
库存数量_1,库存数量_2...
我们看到的是列标题:
销售数量_28
库存数量_28
销售数量_1 和库存数量_1 有时候并不是都是指同一个码。所以只能通过列标题去对应
我之前是这样写:
Dim xsgs As Integer = 0 '有销售的尺码个数
Dim kcgs As Integer = 0 '有销售没有库存的尺码个数
Dim cap2 As String
Dim cap3 As String
For Each r2 As Row In Forms("AA").Controls("table2").Table.Rows
For Each c2 As Col In Forms("AA").Controls("table2").Table.Cols
If c2.Caption.Contains("销售数量_") And c2.Caption.Contains("店仓名称") = False Then
If r2(c2.name) > 0 Then
xsgs = xsgs + 1
cap2 = c2.Caption.Replace("销售数量_","")
End If
End If
Next
Next
上面是算出了有销售的个数了,但不知道怎么算有销售的尺码中,几个是没有库存的
For Each c3 As Col In Forms("AA").Controls("table2").Table.Cols
If c3.Caption.Contains("可用库存_") And c3.Caption.Contains("店仓名称") = False Then
If r3(c3.name) = 0 Then
kcgs = kcgs + 1
cap3 = c3.Caption.Replace("可用库存_","")
End If
End If
Next
[此贴子已经被作者于2017/11/7 15:47:50编辑过]