|
- Function MicroColor(ByVal Target As Range) As Integer
- Dim vFormula As Variant, nI As Integer
- Dim vData As Variant, nRow As Integer, nCol As Integer
- Dim nScore As Integer, nResult As Integer, sFormula As String
-
- vFormula = Sheets("色").UsedRange.Value
- vData = Target.Value
- For nRow = 1 To UBound(vData)
- For nCol = 1 To UBound(vData, 2)
- nScore = Val(vData(nRow, nCol))
- For nI = 2 To UBound(vFormula)
- sFormula = Trim(vFormula(nI, 2))
- If Not (sFormula Like "*分数" Or sFormula Like "分数*") Then sFormula = "And(" & Replace(sFormula, "分数", "分数,分数") & ")"
- If Not IsError(Evaluate(Replace(sFormula, "分数", nScore))) Then
- If Evaluate(Replace(sFormula, "分数", nScore)) Then
- nResult = nResult + Val(vFormula(nI, 1))
- End If
- End If
- Next
- Next
- Next
- MicroColor = nResult
- End Function
复制代码 |
|