+ Reply to Thread
Results 1 to 2 of 2

If there are more than 2 blank adjacent rows, delete them

  1. #1
    Registered User
    Join Date
    06-09-2011
    Location
    Toronto
    MS-Off Ver
    Excel 2007
    Posts
    17

    If there are more than 2 blank adjacent rows, delete them

    Hello,

    I would appreciate some insight or help in getting the following pseudo code translated to VBA... I am checking all rows from ROW 1 to ROW X for blank rows. If it finds more than 2 blank rows, delete the rows until it either hits variable X or makes it 2 blank rows between data, so essentially turning this:

    *Data Rows---*
    *Blank Row*
    *Blank Row*
    *Blank Row*
    *Blank Row*
    *Blank Row*
    *Blank Row*
    *Data Rows---*
    *Blank Row*
    *Blank Row*
    *Blank Row*
    *Row X*

    into this:

    *Data Rows*
    *Blank Row*
    *Blank Row*
    *Data Rows*
    *Blank Row*
    *Blank Row*
    *Row X*

    My Brain is fried right now, and I am at my witts end... I know I must have a for loop and Row X must be subtracted by 1 every time a blank row is found and removed...

    Pseudo Code:
    Please Login or Register  to view this content.

    Thanks for any help, much appreciated!
    Last edited by Jon.R; 08-03-2011 at 10:51 AM.

  2. #2
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    Fl
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    951

    Re: If there are more than 2 blank adjacent rows, delete them

    Hi,

    Maybe?

    Please Login or Register  to view this content.
    Thank You, Mike

    Some Helpful Hints:

    1. New members please read & follow the Forum Rules
    2. Use Code Tags...Place[code]Before the first line and[/code] After the last line.
    3. If you are pleased with a solution mark your post SOLVED.
    4. Thank those who have help you by clicking the scales at the top right of the post.

    Here...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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