+ Reply to Thread
Results 1 to 10 of 10

Delete Blank Rows As far down as first used cell

  1. #1
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Delete Blank Rows As far down as first used cell

    I want a macro to look at col A row 1 and go through each cell in col A starting from the top until data is found in a cell. When this data is found, delete all rows above it.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Delete Blank Rows As far down as first used cell

    How about:

    Please Login or Register  to view this content.
    Gary's Student

  3. #3
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Delete Blank Rows As far down as first used cell

    Thanks!!! Perfect.

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Delete Blank Rows As far down as first used cell

    Thank you for the feedback.

  5. #5
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Delete Blank Rows As far down as first used cell

    Also Jakob, one more thing. How would I alter the code so that when it finds the 3rd used cell that has data in it, it deletes all above it?

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Delete Blank Rows As far down as first used cell

    I would use a slightly different approach:

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Delete Blank Rows As far down as first used cell

    Thanks Jakob. One last issue now and I am finished!.....How can I add an error handler so that if it does not find the 3rd used cell with data in it, that it exits the sub?

  8. #8
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Delete Blank Rows As far down as first used cell

    That should already happen??

  9. #9
    Valued Forum Contributor
    Join Date
    03-03-2009
    Location
    UK
    MS-Off Ver
    MS365 Subscription Excel for Mac
    Posts
    1,017

    Re: Delete Blank Rows As far down as first used cell

    I should re-word it. I want it so that if it doesnt find the 3rd used cell with data, then to delete ALL the rows on the sheet

  10. #10
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Delete Blank Rows As far down as first used cell

    Please Login or Register  to view this content.

+ 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