Mình có một UDF để tìm vị trí số được lặp lại lần thứ n trong một range, nó sẽ tìm đúng vị trí và offset row và col để tìm ra vị trí tương ứng, hàm này trả kết quả đúng nhưng chỉ với điều kiện format các cell phải là bình thường như khi chưa format, nếu có format (number, $,..) thì sẽ báo lỗi. Mong bạn nào cao tay sửa giúp với để cho hàm khi tìm không quan tâm đến format của từng cell trong dãy tìm kiếm. Cảm ơn rất nhiều:
Link
Function FINDNTHOCC(range_look As Range, find_it As String, occurrence As Long, offset_row As Long, offset_col As Long)
Dim lCount As Long
Dim rFound As Range
Set rFound = range_look.Cells(1, 1)
For lCount = 1 To occurrence
Set rFound = range_look.Find(find_it, rFound, xlValues, xlWhole)
Next lCount
FINDNTHOCC = rFound.Offset(offset_row, offset_col)
End Function
Link
Function FINDNTHOCC(range_look As Range, find_it As String, occurrence As Long, offset_row As Long, offset_col As Long)
Dim lCount As Long
Dim rFound As Range
Set rFound = range_look.Cells(1, 1)
For lCount = 1 To occurrence
Set rFound = range_look.Find(find_it, rFound, xlValues, xlWhole)
Next lCount
FINDNTHOCC = rFound.Offset(offset_row, offset_col)
End Function


