|
'实例代码如下:
'=======================
Dim jlzs, i, j As Variant
jlzs = Me.Recordset.RecordCount
For i = 1 To jlzs
Select Case LB
Case "BAND"
ZDSL = ZDSL + sl
ZDFZL = ZDFZL + jz
ZDFJE = ZDFJE + roundtolarger(zje, 0)
ZDAVG = roundtolarger((ZDFJE / (ZDSL + 0.0000001)), 2)
Case "CHUBE"
TGSL = TGSL + sl
TGFZL = TGFZL + jz
TGFJE = TGFJE + roundtolarger(zje, 0)
TGAVG = roundtolarger((TGFJE / (TGSL + 0.0000001)), 2)
Case "COARE"
TXSL = TXSL + sl
TXFZL = TXFZL + jz
TXFJE = TXFJE + roundtolarger(zje, 0)
TXAVG = roundtolarger((TXFJE / (TXSL + 0.0000001)), 2)
Case "CONDENSER"
DRSL = DRSL + sl
DRFZL = DRFZL + jz
DRFJE = DRFJE + roundtolarger(zje, 0)
DRAVG = roundtolarger((DRFJE / (DRSL + 0.0000001)), 2)
.................................
End Select
NEXT I
‘roundtolarger 四舍五入
类别众多 这样写太累
有简化的写法吗?
[em06][em06][em06] |
|