+ Reply to Thread
Results 1 to 3 of 3

Copy Rows from one sheet to another is skipping every other row

  1. #1
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Copy Rows from one sheet to another is skipping every other row

    On the attached example there is a button called 'unsettled hedges', click this and it loads a userform. In this example, there are 10 rows of data that want a value entering into the 'returns' textboxes.

    If you try to enter a value into all of the 'returns' textboxes and click the 'settle hedges' button then all the values from the textboxes should against the relevant row in column L of the 'unsettled hedges' worksheet and then each of these rows should be copied to the next available row in the 'settled hedges' worksheet.

    This isn't happening though, instead, it is copying across every other row from the 'unsettled hedges' worksheet, leaving half of the rows still on the unsettled hedges worksheet.

    Does anyone understand what is wrong with my code?

    Thanks,
    Adam.
    Attached Files Attached Files
    Last edited by adam2308; 11-27-2009 at 07:21 AM.

  2. #2
    Forum Contributor
    Join Date
    04-21-2007
    Location
    Lima, Peru
    MS-Off Ver
    2000, 2007, 2010
    Posts
    674

    Re: Copy Rows from one sheet to another is skipping every other row

    HI

    Yor problem, is that you are deleting the line 'varSourceRow' if the hedge has been settled causing the next line to become the 'varSourceRow' and then increasing the value by 1 effectively causing the code to skip a row. Remove the line
    Please Login or Register  to view this content.
    and everything should work okay.

    Regards

    Jeff

  3. #3
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Copy Rows from one sheet to another is skipping every other row

    Thanks Jeff, that seems to work fine now.

+ 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