+ Reply to Thread
Results 1 to 3 of 3

Remove all empty rows in a worksheet

  1. #1
    Registered User
    Join Date
    02-01-2006
    Posts
    9

    Remove all empty rows in a worksheet

    is there a way in VBA to remove all empty rows in a worksheet 'Sheet1'?

    I maybe did not explained it Properly, But Please Refer to the Attched File, to Know Exactly what I need.
    and I Really Appreciate your Help and Effort.
    Attached Files Attached Files
    Last edited by wrangler; 02-07-2006 at 04:32 AM.

  2. #2
    Tom Ogilvy
    Guest

    Re: Remove all empty rows in a worksheet

    Assume if the cell in column A is empty, then the row should be removed

    Dim rng as Range
    On Error Resume Next
    set rng = ActiveSheet.Columns(1).SpecialCells(xlBlanks)
    On Error goto 0
    if not rng is nothing then
    rng.EntireRow.Delete
    End if

    --
    Regards,
    Tom Ogilvy


    "wrangler" <[email protected]> wrote in
    message news:[email protected]...
    >
    > *-is there a way in VBA to remove all empty rows in a worksheet
    > 'Sheet1'?-*
    >
    >
    > +-------------------------------------------------------------------+
    > |Filename: Remove all empty rows in a worksheet.zip |
    > |Download: http://www.excelforum.com/attachment.php?postid=4326 |
    > +-------------------------------------------------------------------+
    >
    > --
    > wrangler
    > ------------------------------------------------------------------------
    > wrangler's Profile:

    http://www.excelforum.com/member.php...o&userid=31048
    > View this thread: http://www.excelforum.com/showthread...hreadid=508980
    >




  3. #3
    Registered User
    Join Date
    02-01-2006
    Posts
    9
    Quote Originally Posted by Tom Ogilvy
    Assume if the cell in column A is empty, then the row should be removed

    Dim rng as Range
    On Error Resume Next
    set rng = ActiveSheet.Columns(1).SpecialCells(xlBlanks)
    On Error goto 0
    if not rng is nothing then
    rng.EntireRow.Delete
    End if

    --
    Regards,
    Tom Ogilvy


    "wrangler" <[email protected]> wrote in
    message news:[email protected]...
    >
    > *-is there a way in VBA to remove all empty rows in a worksheet
    > 'Sheet1'?-*
    >
    >
    > +-------------------------------------------------------------------+
    > |Filename: Remove all empty rows in a worksheet.zip |
    > |Download: http://www.excelforum.com/attachment.php?postid=4326 |
    > +-------------------------------------------------------------------+
    >
    > --
    > wrangler
    > ------------------------------------------------------------------------
    > wrangler's Profile:

    http://www.excelforum.com/member.php...o&userid=31048
    > View this thread: http://www.excelforum.com/showthread...hreadid=508980
    >
    Thank you for replying and I appreciate your effort, but your VBA dos not fit my Requirement, If you Please Refer to the attachment File, you will be aple to see my Dilemma.

    wrangler

    Thanks

+ 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