+ Reply to Thread
Results 1 to 6 of 6

Insert a blank row before bracketed text

Hybrid View

bvlahides Insert a blank row before... 04-03-2013, 07:38 PM
davesexcel Re: Insert a blank row before... 04-03-2013, 07:48 PM
bvlahides Re: Insert a blank row before... 04-04-2013, 12:52 PM
davesexcel Re: Insert a blank row before... 04-04-2013, 07:08 PM
bvlahides Re: Insert a blank row before... 04-04-2013, 07:17 PM
jindon Re: Insert a blank row before... 04-04-2013, 08:19 PM
  1. #1
    Registered User
    Join Date
    04-03-2013
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    3

    Insert a blank row before bracketed text

    Hi - Am trying to auto insert blank rows (2 or 3) before a row containing bracketed text. All data is in a single column. I'd appreciate any advice. Thanks.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Insert a blank row before bracketed text

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    04-03-2013
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Insert a blank row before bracketed text

    Hi - Thanks. I've attached a sample ( if I did it right) Am using Excel in an unorthodox way.... I appreciate your help!Before and After.xlsx

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525

    Re: Insert a blank row before bracketed text

    How about after each row that has the words "Talent Notes:" ?

  5. #5
    Registered User
    Join Date
    04-03-2013
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Insert a blank row before bracketed text

    A blank after talent notes is nice to have. I really need 2-3 blanks before "[TS*]. Thanks!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Insert a blank row before bracketed text

    This should do what you want
    Sub test()
        Dim i As Long, flg As Boolean
        On Error Resume Next
        Columns("b").SpecialCells(4).EntireRow.Delete
        On Error GoTo 0
        For i = Range("b" & Rows.Count).End(xlUp).Row To 2 Step -1
            If Cells(i, 2).Value Like "[[]*[]]" Then
                If Not flg Then Rows(i + 1).Insert: flg = True
            Else
                If flg Then Rows(i + 1).Resize(2).Insert: flg = False
            End If
        Next
    End Sub

+ 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