+ Reply to Thread
Results 1 to 5 of 5

Delete blank rows in an Excel table using a VBA Macro

  1. #1
    Registered User
    Join Date
    12-08-2013
    Location
    United States
    MS-Off Ver
    Microsoft 365
    Posts
    57

    Delete blank rows in an Excel table using a VBA Macro

    I would like to use a VBA Macro to automatically delete blank row in an Excel table. I have seen examples on how to delete rows in an Excel spreadsheet, but not for an Excel table.

    Does anyone have an example on how to automatically delete blank rows in an Excel table using a VBA macro? Thanks!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Delete blank rows in an Excel table using a VBA Macro

    Hi Excel987,

    The trick to the problem is to start at the last row and move up, checking if the row is blank (or the cell is blank in your column). Then when you use VBA to delete the EntireRow it will work. Many people try to start at the top and move down which doesn't work well when two blank rows are next to each other. If you supply a sample workbook, showing what you have, the VBA is easier for us to write...

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Delete blank rows in an Excel table using a VBA Macro

    Why not try a sort to move the blank rows to the bottom of your table.

  4. #4
    Registered User
    Join Date
    12-08-2013
    Location
    United States
    MS-Off Ver
    Microsoft 365
    Posts
    57

    Re: Delete blank rows in an Excel table using a VBA Macro

    Hi MarvinP,
    I was able to find the solution to deleting blank rows in an Excel table using a VBA Macro. Thanks you for responding to my post. Below is the code:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-08-2013
    Location
    United States
    MS-Off Ver
    Microsoft 365
    Posts
    57

    Re: Delete blank rows in an Excel table using a VBA Macro

    Hi dangelor,
    I was able to find the solution to deleting blank rows in an Excel table using a VBA Macro. Thanks you for responding to my post. Below is the code:

    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] VBA Code to Delete All Blank Rows in Table
    By fredfarmer in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-26-2019, 10:58 AM
  2. Need Macro to delete all blank rows
    By caanilsoni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-13-2015, 12:59 AM
  3. Macro to delete blank rows if column I is blank for the row
    By tiger10012 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-10-2013, 03:01 PM
  4. Macro to delete blank rows
    By ewong in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2012, 02:38 PM
  5. delete blank rows macro
    By robihr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-28-2011, 12:08 PM
  6. Excel 2003 - Macro to Find Page Range and Delete All Blank Rows
    By AnneL in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-25-2011, 04:50 PM
  7. Macro to delete blank rows
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2005, 06:05 PM

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