Hi,
I get i little puzzled when I see you function LastInRange.
Isn't your intention to get an answer of let's say 50, it the last number if 50 rows down?
Is there any special reason to why you check for numeric values only?
What is the explanation to why you have written LastInRange = "" at the end? This will always give an empty answer back.
I tried this code instead (see below). Both this and yours is fast. How long time does the function take when you use it?
Best regards
Bjorn
Function LastInRange2(InputRange As Range)
Dim CellCount As Long
Dim i As Long
CellCount = InputRange.Count
For i = CellCount To 1 Step -1
If Not IsEmpty(InputRange(i)) And IsNumeric(InputRange(i)) Then
LastInRange2 = i
Exit Function
End If
Next i
End Function
|