Function to find last value in a column
Simply superb.
Swastik
On Monday, January 28, 2008 2:01:10 AM UTC+5:30, Gord Dibben wrote:
Why not use the functions Excel provides?
=LOOKUP(99^99,A:A) will fetch the last numeric in column A
=LOOKUP(REPT("z",255),A:A) fetch last text value in column A
=LOOKUP(2,1/(A1:A65535<""),A1:A65535) fetch wha is in last cell of column A
Gord Dibben MS Excel MVP
On Sun, 27 Jan 2008 12:01:00 -0800, Andyjim
wrote:
Hi-
I submitted this post without entering anything on the subject line. So I
am re-entering this. I need to create a function that can be placed in a
cell that will display the last number in another column. Below are some
attempts, but no success. Thanks for your help!
Andy
Function LastValue(lastno As Variant)
Dim sysexpcol As Range
Set sysexpcol = Range(ad16, ad56)
Set lastno = sysexpcol(Cells.Value.xlDown)
End Function
Function lastvalueincolumn(foundcell As Variant)
With Worksheets("analysis").Range("ad:ad")
Set foundcell = .Cells.Find.Value.xlDown
End With
End Function
|