+ Reply to Thread
Results 1 to 8 of 8

Find last row that contains data and clear/delete all blank rows after it

  1. #1
    Registered User
    Join Date
    01-28-2015
    Location
    Tampa, FL
    MS-Off Ver
    2010
    Posts
    104

    Find last row that contains data and clear/delete all blank rows after it

    Is there a quick and efficient VBA code I could write to accomplish this? Everything I find online seems very complex.

  2. #2
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Find last row that contains data and clear/delete all blank rows after it

    What are you clearing if the rows are already blank?

  3. #3
    Registered User
    Join Date
    01-28-2015
    Location
    Tampa, FL
    MS-Off Ver
    2010
    Posts
    104

    Re: Find last row that contains data and clear/delete all blank rows after it

    I am cut and pasting a bunch of data and columns on a daily basis each morning. The amount of rows vary. The person who creates the source file I am copying has columns of formulas in the far right side of the sheet that go down to the 60K row range so that he doesn't have to copy/paste down the formulas each day. Therefore, there are blank rows that display nothing, but contain some formulas.

  4. #4
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Find last row that contains data and clear/delete all blank rows after it

    Quote Originally Posted by tkbuc View Post
    The person who creates the source file I am copying has columns of formulas in the far right side of the sheet that go down to the 60K row range so that he doesn't have to copy/paste down the formulas each day.
    If that is the only column like that, which column is it?

    Do you have formulas in any other columns?

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Find last row that contains data and clear/delete all blank rows after it

    Try on a copy of your workbook
    Please Login or Register  to view this content.
    And for Columns:
    Please Login or Register  to view this content.
    Last edited by jolivanes; 09-30-2019 at 07:04 PM. Reason: Code for columns

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Find last row that contains data and clear/delete all blank rows after it

    Please Login or Register  to view this content.
    If the data you are keeping does not have formulas you can also use SpecialCells.

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,516

    Re: Find last row that contains data and clear/delete all blank rows after it

    Please Login or Register  to view this content.

  8. #8
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Find last row that contains data and clear/delete all blank rows after it

    The following macro will clear all rows that are either blank or have a formula displaying the empty text string ("") that are located after the last displayed non-blank value (whether it is a constant or from a formula)...
    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)

Similar Threads

  1. [SOLVED] Delete blank rows between blocks of data except two blank rows
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-26-2018, 11:18 AM
  2. How to find the blank rows and then delete them/shift them up
    By travis.cook21 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-13-2015, 11:52 AM
  3. [SOLVED] VBA Find last row and column that contain data and delete all blank rows and blank columns
    By bcn1988 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-03-2012, 01:07 PM
  4. [SOLVED] Find first blank row, count up X number of rows and delete
    By BeachRock in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-04-2012, 11:03 PM
  5. Replies: 1
    Last Post: 05-10-2012, 04:58 PM
  6. Help to clear data & delete rows
    By Eddy Stan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-11-2006, 06:35 AM

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