Consulting

Results 1 to 4 of 4

Thread: how do i check the last data on Column B and return a text

  1. #1
    VBAX Regular
    Joined
    May 2008
    Posts
    11
    Location

    how do i check the last data on Column B and return a text

    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

  2. #2
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    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.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

  3. #3
    VBAX Regular
    Joined
    May 2008
    Posts
    11
    Location
    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

  4. #4
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    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.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •