-5
我需要計算以下代碼的百分比。使用VBA計算百分比
單元格AE43給出總計數。
單元AE51給出有效計數。
單元格AE53應該爲此保留%。
Sub WBR()
Dim Count1Criteria As Variant
Dim Count3Criteria As Variant
Dim test As Variant
Dim wf As WorksheetFunction
Set wf = Application.WorksheetFunction
Filter1InSummary = Array(Array("AE4", "Latency", "O:O", "Pass"), _
Array("AE51", "TT", "G:G", "Yes"), _
Array("AE52", "TT", "G:G", "No"), _
Array("AE61", "Reactive", "R:R", "Item"))
Filter3InSummary = Array(Array("AE43", "TT", "I:I", "<>Duplicate TT", _
"G:G", "<>Not Tested", _
"U:U", "Item"))
For Each test In Filter3InSummary
With Worksheets(test(1))
Range(test(0)) = wf.CountIfs(.Range(test(2)), test(3), _
.Range(test(4)), test(5), _
.Range(test(6)), test(7))
End With
Next
不知道什麼是你想要做 – Hiten004