hungtttv
Thành viên mới
![](/diendan/data/PhoToDanhHieu/gold.gif)
- Tham gia
- 6/2/10
- Bài viết
- 22
- Được thích
- 13
Em nộp bài MyMaxIf ạ!!!
Mã:
Function MyMaxIf(ByVal rngTest As Range, _
ByVal TestValue As Variant, _
ByVal rngValue As Range) As Double
Dim i As Long
Dim lCountRows As Long
MyMaxIf = -2147483648#
lCountRows = rngTest.Rows.Count
For i = 1 To lCountRows
If rngTest(i).Value = TestValue Then
If MyMaxIf < rngValue(i).Value Then
MyMaxIf = rngValue(i).Value
End If
End If
Next i
End Function
File đính kèm
Lần chỉnh sửa cuối: