+ Reply to Thread
Results 1 to 2 of 2

Working While Statement Stops Working

  1. #1
    Registered User
    Join Date
    05-10-2011
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    2

    Working While Statement Stops Working

    I promise I have searched thoroughly for an answer before posting...I'm not that lazy...
    And I have many hours invested in trying to resolve this on my own...but obviously my skills are limited our I wouldn't be supplicating to the gods of Excel in this forum (I have solved many a prior issue reading solutions here...).

    I am copying the content of a cell in one workbook to another. I iterate through the rows by each column needed to copy the source then paste in the target.

    I test that the source row contains data with CStr in the first column. It works about 900 times then suddenly stops (at the same point every time).

    The source sheet has 41 rows. I can't copy the whole rows because there isn't a direct mapping to the target sheet. I need specific columns in the source and to paste to specific columns in the target. The rows do match 1 for 1 however.

    I have a separate macro for each column needed because I am too simple to use variable appropriately. Below is an example of the macro that fails. The code is identical for each macro and is called by a master macro. the macro below passes the While test 12 times then fails (even though row 13 has data). Among the set of macros pasting to the target sheet, the While tests true about 900 times, and the fact that is tests true 12 times then fails in the questionable macro is really surprising to me.

    Please Login or Register  to view this content.
    I wouldn't be so spooked if the loop the While statment didn't work at all, but the fact that it *stops* working seems very strange.... And that row 13 test true for every other macro using the same loop (just with different column variables) seems even weirder...

    Thanks in advance for any help.

    John

  2. #2
    Registered User
    Join Date
    05-10-2011
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Working While Statement Stops Working

    Please ignore this post.... Of course, after posting this I found the problem....but thanks for being there anyway, this forum ROCKS!!

+ 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