+ Reply to Thread
Results 1 to 3 of 3

Selection.EntireRow.Insert Inserts too many Rows!

  1. #1
    Registered User
    Join Date
    05-24-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    10

    Selection.EntireRow.Insert Inserts too many Rows!

    I have written a simple code to sort and separate data in my spreadsheet. The issue I am having is when it separates the data, instead of the insertrow function only inserting one row, it inserts the same number of rows as the data it is moving. i.e. If the data has 15 rows, with 10 being alike, and the other 5 alike, it will insert a row after the 10th row, but it will insert 5 blank separating rows (corresponding to the number of rows it has displaced) instead of 1. What am I doing wrong here?

    Thanks!

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Selection.EntireRow.Insert Inserts too many Rows!

    The problem is this:

    Please Login or Register  to view this content.
    You insert a row, and then on the next loop, the values don't match and so it add another row.

    You might change it to:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-24-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Selection.EntireRow.Insert Inserts too many Rows!

    That solved the issue, thank you!

+ 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