+ Reply to Thread
Results 1 to 5 of 5

Find end of list

  1. #1
    Maria
    Guest

    Find end of list

    Hello again!

    To explain my problem properly: My macro fills in data
    into a column with the length of the range called "vol1"
    daily. Sometimes, if no value is found from the data
    sources, it leaves cells blank. Now, I'd like to find the
    end of the list (last entry) but can't use the specialCells
    (xlCellTypeBlanks) command (because an empty cell might
    not be the last entry). Is there any other option? I think
    the macro needs to check if from one empty cell on all
    following cells (until the end of the range) are empty too.

    I hope someone can help! Thanks again,

    Maria

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Maria,

    Have Excel start at the bottom of the page for the column you are checking and come up the rows until the row is non-blank. You can do this using the Range's .End property.

    Example to Find Last Row in Coulmn "A":
    LastRow = Range("A" & Rows.Count).End(xlUp).Row

    Change the column letter to match the one you are checking in your code.

    Sincerely,
    Leith Ross

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835
    have you tried

    Ctrl + down Arrow key?

    it will lead you to the last cell in the column which has consecutive entry.
    i.e. if you have A1:A10 entered and A15:A18 entered.
    if A1 is activated and the key conbination will take you to A10.(Last cell in the consectutive entry)

    in a macro, the syntax is

    Please Login or Register  to view this content.
    hope this helps

  4. #4
    Bob Phillips
    Guest

    Re: Find end of list


    iLastRow = Cells(Rows.Count,"A").End(xlUp).Row

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Maria" <[email protected]> wrote in message
    news:[email protected]...
    > Hello again!
    >
    > To explain my problem properly: My macro fills in data
    > into a column with the length of the range called "vol1"
    > daily. Sometimes, if no value is found from the data
    > sources, it leaves cells blank. Now, I'd like to find the
    > end of the list (last entry) but can't use the specialCells
    > (xlCellTypeBlanks) command (because an empty cell might
    > not be the last entry). Is there any other option? I think
    > the macro needs to check if from one empty cell on all
    > following cells (until the end of the range) are empty too.
    >
    > I hope someone can help! Thanks again,
    >
    > Maria




  5. #5
    Maria
    Guest

    Re: Find end of list

    Thank you! It worked!

    >-----Original Message-----
    >
    > iLastRow = Cells(Rows.Count,"A").End(xlUp).Row
    >
    >--
    >
    >HTH
    >
    >RP
    >(remove nothere from the email address if mailing direct)
    >
    >
    >"Maria" <[email protected]> wrote in

    message
    >news:[email protected]...
    >> Hello again!
    >>
    >> To explain my problem properly: My macro fills in data
    >> into a column with the length of the range called "vol1"
    >> daily. Sometimes, if no value is found from the data
    >> sources, it leaves cells blank. Now, I'd like to find

    the
    >> end of the list (last entry) but can't use the

    specialCells
    >> (xlCellTypeBlanks) command (because an empty cell might
    >> not be the last entry). Is there any other option? I

    think
    >> the macro needs to check if from one empty cell on all
    >> following cells (until the end of the range) are empty

    too.
    >>
    >> I hope someone can help! Thanks again,
    >>
    >> Maria

    >
    >
    >.
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1