Results 1 to 10 of 10

Thread: [2005] Excel- Finding last used cell in a column.

Threaded View

  1. #6
    Frenzied Member stimbo's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,739

    Re: [2005] Excel- Finding last used cell in a column.

    I found a post by Rob

    Excel last row post

    I think this bit might be of interest. I could be completely wrong but the 1 here may refer to column A. So just adapt it from that. Does it work?
    VB Code:
    1. MessageBox.Show(wksht.Cells(1,wksht.Cells.SpecialCells(xlCellTypeLastCell).Row).Value.ToString)

    EDIT::::

    Should be this:
    VB Code:
    1. MessageBox.Show(wksht.Cells(1,wksht.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row).Value.ToString)
    Last edited by stimbo; Feb 7th, 2007 at 11:32 AM.
    Stim

    Free VB.NET Book Chapter
    Visual Basic 2005 Cookbook Sample Chapter

Posting Permissions

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



Click Here to Expand Forum to Full Width