Read Last Inputted Value?

Y

Yin99

Lets say I have a range of cells:
Value1
Value2
Value3
Value4



How could I get Excel to (worksheet function, or vb macro) to read a
Range of cells, and simply tell me what is the last value in the list?
So in this case it would return Value4.

However, if I had
Value1
Value2

it would return Value2. I know I could probably write a vb macro to
look at each cell in a specified range, call ISBLANK(Cell) ... Soon as
I get TRUE, I know the value I was looking for was the last ISBLANK I
called. But, is there an easier way? THanks,

Yin99
 
J

jtp

Sub FindLastCell()
Dim cell as Range

set cell = Activesheet.Range("A1").end(xldown)

end sub
 
S

skatonni via OfficeKB.com

If the values are in Column A starting in the first row

Sub lastValue()

Range("A1").Select
MsgBox Selection.End(xlDown).Value

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top