PDA

View Full Version : how do i check the last data on Column B and return a text



GohLS
10-20-2010, 11:31 AM
Hi,
i am a newbie to Marcos, so need some help here.
i am going to check on data on column B and then return a text after the last row of column B..

unable to find any topic in the forum..

pls help
Thanks

Simon Lloyd
10-20-2010, 11:53 AM
To find the contents of the text of last cell in a range use this:
=INDEX(B:B,MATCH(REPT("z",255),B:B))
If your cell contains just numbers then use this:
=INDEX(B:B,MATCH(9.99999999999999E+307,B:B))
if your cell contains a mixture of text and numbers then use this:
=INDEX(B:B,MAX(MATCH(9.99999999999999E+307,B:B),MATCH(REPT("z",255),B:B)))

They're not array formulas so don't need to be entered with Ctrl+Shift+Enter.

GohLS
10-20-2010, 12:03 PM
i think that is Excel function, i think i should call it VBA..
i found this but it only get to last row of Column A

Cells(Rows.Count, Selection.Column).End(xlUp).Select

i need it to be in cloumn B as therewill be no blank or empty cell..
furthermore after the last row (Example "B10" , then at "B11" i should have a text " *END OF SUMMARY*)

i am tabulating a report.. only got stuck on the last part..
kindly advise if anyone who can help
thanks

Simon Lloyd
10-20-2010, 12:33 PM
What is it you are trying to do? just explain plainly as you don't need vba to show the contents of the last cell in a range, if you do want vba then you can simply evaluate that formual to see if it equates to what you're looking for.