• Copy Row/Insert

    Author
    Topic
    #461948

    I have a challenge where I copy a row and insert it between rows that are grouped. After the insert, a new group is established. How do I prevent the new group from appearing? There is nothing in the code to create a new group.

    I have attached a sample file.

    Thanks,
    Johh

    Viewing 1 reply thread
    Author
    Replies
    • #1173940

      I think you’ll have to remove the outline temporarily:

      Code:
      Sub Copy_Insert_Row()
        Const oNewRow = 15
        ' Remove outline
        Range("A12").ClearOutline
        ' Copy row
        Rows(8).Copy
        ' Insert/paste row
        Rows(oNewRow).Insert
        ' Recreate outline
        Range("A12").AutoOutline
      End Sub
    • #1173943

      Hans,

      The example file had only one grouping; my file has many groups. By using the line of code to “ClearOUtline”, it removes all groupings. I’m interested in just that one grouping.

      Regards,
      John

      • #1173952

        You’d have to figure out how to recreate the grouping in your situation…

      • #1173953

        Hans,

        I was able to come up with a work around where instead of copying the row; copy a range.

        In the example it would be Range(“A8:E8”). This over comes the group challenge.

        Thank you,
        John

    Viewing 1 reply thread
    Reply To: Copy Row/Insert

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: