+ Reply to Thread
Results 1 to 4 of 4

Adding Blank Rows

Hybrid View

anwaee2 Adding Blank Rows 11-23-2013, 02:40 PM
berlan Re: Adding Blank Rows 11-23-2013, 03:02 PM
anwaee2 Re: Adding Blank Rows 11-23-2013, 03:09 PM
berlan Re: Adding Blank Rows 11-23-2013, 03:13 PM
  1. #1
    Registered User
    Join Date
    09-14-2012
    Location
    Alabama
    MS-Off Ver
    Office for Mac 2011
    Posts
    26

    Adding Blank Rows

    I am trying to add a blank row between any names that don't match. My macro adds rows but not completely right. Attached is my workbook. All macros work accept for By_Games. Some of the blank rows go in the right places and some don't. I would appreciate any help I can get. Thanks in advance.
    Attached Files Attached Files
    Last edited by anwaee2; 11-23-2013 at 02:56 PM.

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Adding Blank Rows

    Comparing the first words of each cell, you can try this:

            Dim i As Long
            
            With W8        'ActiveWorkbook.Worksheets("Standings")
                For i = .Cells(Rows.Count, 1).End(xlUp).Row To 5 Step -1        'with step back
                    If Len(.Range("A" & i - 1)) > 0 Then
                        If Left(.Range("A" & i), InStr(1, .Range("A" & i), " ") - 1) <> Left(.Range("A" & i - 1), InStr(1, .Range("A" & i - 1), " ") - 1) Then
                            .Range("A" & i).EntireRow.Insert
                        End If
                    End If
                Next i
            End With

  3. #3
    Registered User
    Join Date
    09-14-2012
    Location
    Alabama
    MS-Off Ver
    Office for Mac 2011
    Posts
    26

    Re: Adding Blank Rows

    Perfect!!!! Thank you so much. I will be studying that code to see why it works. Thanks again.

  4. #4
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Adding Blank Rows

    You're welcome! Adding/deleting rows can be easier with step -1, counting from the bottom of the range

+ 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] Adding blank rows
    By Jietoh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-05-2013, 03:15 PM
  2. Adding two blank rows
    By missytordrup in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2011, 03:57 AM
  3. Adding blank rows between series of row
    By Shadmani in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 06-23-2010, 04:12 AM
  4. Adding a blank row in between excisting rows
    By ..Sam.. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2009, 12:53 AM
  5. Adding Blank Rows
    By John1950 in forum Excel General
    Replies: 2
    Last Post: 09-19-2007, 09:26 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