P
Bạn ơi, hàm bạn tạo mình thấy lỗi tên #Name?
Option Explicit
Function SoLonHon0(CSDL As Range, Ten As String)
Dim J As Long, Max_ As Double
Dim Rng As Range, Cls As Range
Set Rng = CSDL(1).Offset(, 1).Resize(CSDL.Rows.Count)
Max_ = Application.WorksheetFunction.Max(Rng) + 0.9
For Each Cls In CSDL
With Cls.Offset(, 1)
If Cls.Value = Ten And .Value < Max_ And .Value > 0 Then
Max_ = Cls.Offset(, 1).Value
End If
End With
Next Cls
SoLonHon0 = Max_
End Function