Results 1 to 6 of 6

Thread: How to find the last row used in a column ??

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    63

    Question How to find the last row used in a column ??

    Hey guys!

    How can i find out the last used row number (last row with a string in it)
    in a particular column.

    I have to search for strings one by one in columns and perform certain actions on them but i first need to find out how many strings there are so that i can make an appropriate loop.

    Please advise


    cheers
    Abhilash

  2. #2
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: How to find the last row used in a column ??

    What application are you using?

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  3. #3

    Thread Starter
    Member
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    63

    Re: How to find the last row used in a column ??

    I am using VB.Net 2005

  4. #4
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: How to find the last row used in a column ??

    Since there isn't really columns n rows in vb.2005, what are you using it with... access or excel?

    I know a bit of VBA but not much of .net. I may be able to point you in the right direction tho

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

  5. #5

    Thread Starter
    Member
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    63

    Re: How to find the last row used in a column ??

    I am using Excel.. sorry i forgot to mention that earlier.. I am guessing VBA cud help me..


    cheers
    Abhilash

  6. #6
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: How to find the last row used in a column ??

    There is a property in Excel vba to get the bottom most cell used. however sometimes it thinks its used and its not


    So I'd recommend the following:
    Make sure you have a column that is guarenteed to have data.
    from the lowest cell in that column do the end+up combo.
    You should now be on the lowest row of data.

    You can record this action in a macro to see how it works. Should be something like:
    Code:
    msgbox "Bottom Row : " & sht.cells(65000,1).end(xlup).row
    From in excel. The sht is the worksheet, xlup is a constant, you can get this from the immediates windo in excel vba.

    You can also come from above, but if you only have a title row it is not helpful.
    Does that help?

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

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