Need help on a UDF (Find n occurrence position)
Hi experts,
I have one of the Find n occurrence UDF long time ago (see below), this function will find the position of the n occurrence of a number from a range then offset it. This work fine but trouble when the range that it looks for doesn't count the cell with different format then return error, you can find it very easy when you open my attachment. Can you help me tweak this UDF a bit so it can neglect the format. Thank you so much for help.

Note: I cannot attach the file but you can try this by add this function to your book

-----------

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
July 11th, 2014 7:46pm

This UDF is not designed to find a Number, it is designed to find a String.
Free Windows Admin Tool Kit Click here and download it now
July 13th, 2014 2:00pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics