+ Reply to Thread
Results 1 to 8 of 8

inserting two blank lines when based on data in a column

Hybrid View

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: inserting two blank lines when based on data in a column

    I appreciate your help. I noticed when I expanded my testing that your solution only covers the one column. Is there a way to insert blank rows (as opposed to cells) in the same manner?

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: inserting two blank lines when based on data in a column

    Try:

    Sub ElConquistador()
    Dim i As Long
    For i = ActiveSheet.UsedRange.Rows.count To 2 Step -1
        If Range("A" & i).Value <> Range("A" & i).Offset(1).Value Then
            Range("A" & i).EntireRow.Offset(1).Resize(2).Insert xlDown
        End If
    Next i
    End Sub

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    56

    Re: inserting two blank lines when based on data in a column

    thank you very much!

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: inserting two blank lines when based on data in a column

    Again you're welcome, and thanks for the rep.

+ 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. Inserting a blank Row based on column groups
    By OLBaID in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-09-2013, 04:32 PM
  2. Removing blank lines based on first column
    By SWMagic in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2013, 03:31 AM
  3. Replies: 3
    Last Post: 04-11-2012, 11:00 AM
  4. Inserting blank rows when data in column changes
    By pixifaery in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-24-2010, 05:43 PM
  5. Inserting Blank Lines
    By LPM in forum Excel General
    Replies: 7
    Last Post: 09-14-2005, 03: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