狐爸帮忙看看这段代码,做上100次循环居然要1分钟左右。请帮忙优化下。感谢!
For Each r As DataRow In DtEmployee.DataRows
strCName = r("员工姓名")
If strCName = strCCName Then
strTel = r("联系电话")
'=====
'面护
'=====
strF =strFilter2 & " And [项目大类] = '面护'"
nXCount = DtCstmCard.Compute("Sum(期初金额)", strF)
DtEmployee.DataCols("面护_销售业绩").AllowEdit = True
r("面护_销售业绩") = nXCount
DtEmployee.DataCols("面护_销售业绩").AllowEdit = False
strF =strFilter & " And [项目大类] = '面护'"
nSCount = DtNurse.Compute("Sum(次数)", strF)
DtEmployee.DataCols("面护_护理次数").AllowEdit = True
r("面护_护理次数") = nSCount
DtEmployee.DataCols("面护_护理次数").AllowEdit = False
NEXT
END IF