Is this a code snippet?
Code:
With oOS
lngOSLastRow = oOS.Range("A" & oOS.Rows.count).End(xlUp).Row
If oFrm.optCreateFam Then
oBasicBar.StatusMessage = "Defining Family relationship ... Please Wait"
' co lngRecordIndex dong du lieu trong OVERLAY
lngOSRow = 2
Do While Len(.Cells(lngOSRow, 1).value) > 0
'See min3 function notes below for more information
.Cells(lngOSRow, lngOS_FamColNum) = min3(.Range(Cells(2, lngOS_FamMatchColIndex), Cells(lngOSLastRow, lngOS_FamMatchColIndex)), .Cells(lngOSRow, lngOS_FamMatchColIndex).value, .Range(Cells(2, lngOS_NDSRIColNum), Cells(lngOSLastRow, lngOS_NDSRIColNum)), .Range(Cells(2, 1), Cells(lngOSLastRow, 1)))
If .Cells(lngOSRow, lngOS_FamColNum) <> .Cells(lngOSRow, 1) Then
If WorksheetFunction.CountIfs(.Range(Cells(2, lngOS_FamMatchColIndex), Cells(lngOSLastRow, lngOS_FamMatchColIndex)), .Cells(lngOSRow, lngOS_FamMatchColIndex).value, .Range(Cells(2, 1), Cells(lngOSLastRow, 1)), .Cells(lngOSRow, lngOS_ParColNum)) = 0 Then
.Cells(lngOSRow, lngOS_ParColNum) = .Cells(lngOSRow, lngOS_FamColNum)
End If
End If
lngOSRow = lngOSRow + 1
If lngOSRow Mod 100 = 0 Then oBasicBar.StepBar
Loop
End If
Do you want to write the above fragment and function min3 differently?
It is now 11:00 (UTC+01:00). I will check in the evening