Hi Rogerio,
see
http://www.mvps.org/dmcritchie/excel...l.htm#formulas
and your User Defined Function should not be using Integer instead use Long
and instead of 65536 use cells.rows.count
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
"Rogerio Takejame" wrote in message
...
I use the UDF below to find the value of the last cell in a certain column.
But I use this function in many worksheets which will be sent do many people.
I want to avoid the attachment of the function in each worksheet and also to
avoide the use of .XLA. Is there a way to have the same results only with
worksheet functions in a way that any standard Excel could calculate?
Function ultima(col As Integer) As Variant
Application.Volatile
If Cells(65536, col) = "" Then
ultima = Cells(65536, col).End(xlUp).Value
Else
ultima = Cells(65536, col).Value
End If
End Function
--
Rogerio Takejame
Americana - Sao Paulo - Brazil