本帖最后由 heroxianf 于 2016-9-29 13:31 编辑
我一直等着这个东西完成了,再来请教大家给我优化一下,总感觉逻辑厉害的 几行就可以搞定
For $Row = 0 To UBound($ProdArray, 2) - 2
$oConditions[0] = UBound(StringRegExp($ProdArray[3][$Row + 1], $oExp[0], 3))
$oConditions[1] = UBound(StringRegExp($ProdArray[3][$Row + 1], $oExp[1], 3))
$oConditions[2] = UBound(StringRegExp($ProdArray[3][$Row + 1], $oExp[2], 3))
Select
Case $oConditions[0] > 0 and $oConditions[1] > 0 and $oConditions[2] > 0
_Excel_RangeWrite($oWorkbook, Default, '业务', 'E' & $Row + 2)
Case $oConditions[0] > 0 and $oConditions[1] > 0 and $oConditions[2] = 0
_Excel_RangeWrite($oWorkbook, Default, '业务', 'E' & $Row + 2)
Case $oConditions[0] > 0 and $oConditions[1] = 0 and $oConditions[2] > 0
_Excel_RangeWrite($oWorkbook, Default, '业务', 'E' & $Row + 2)
Case $oConditions[0] > 0 and $oConditions[1] = 0 and $oConditions[2] = 0
_Excel_RangeWrite($oWorkbook, Default, '业务', 'E' & $Row + 2)
Case $oConditions[0] = 0 and $oConditions[1] > 0 and $oConditions[2] > 0
_Excel_RangeWrite($oWorkbook, Default, '业务', 'E' & $Row + 2)
Case $oConditions[0] = 0 and $oConditions[1] > 0 and $oConditions[2] = 0
_Excel_RangeWrite($oWorkbook, Default, '业务', 'E' & $Row + 2)
Case $oConditions[0] = 0 and $oConditions[1] = 0 and $oConditions[2] > 0
_Excel_RangeWrite($oWorkbook, Default, '1', 'E' & $Row + 2)
Case $oConditions[0] = 0 and $oConditions[1] = 0 and $oConditions[2] = 0
_Excel_RangeWrite($oWorkbook, Default, 'Other', 'E' & $Row + 2)
EndSelect
Sleep(10)
; MsgBox(0, $Row + 1, $oConditions[0] & '-' & $oConditions[1] & '-' & $oConditions[2] & '-' & $ProdArray[3][$Row + 1], 1)
Next
|