+ Reply to Thread
Results 1 to 6 of 6

Do Until Loop Not Working

  1. #1
    Registered User
    Join Date
    05-04-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Do Until Loop Not Working

    Hi All,

    I have a macro that pulls rows from a tab called "Report" to the tab "New Employees" based on the value "NEW" in Column R. It also pulls rows to the tab "Existing Employees" based on the value "Existing" in Column S. Both of these codes work fine when I split them up into two macros, but when I combine them into the code below, only the "New Employees" tab gets populated; the "Existing Employees" tab does not. Can anyone help me figure out why I'm running into this problem? Thanks in advance for your help!
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 10-30-2015 at 04:18 PM. Reason: Added Code Tags

  2. #2
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Do Until Loop Not Working

    Hi
    Without a sample of your Data , and / or a more fuller description, one can only make a few guesses.
    This would be the immediate guess, I guess!


    Please Login or Register  to view this content.
    Alan
    '_- Google first, like this _ site:ExcelForum.com Gamut
    Use Code Tags: Highlight code; click on the # icon above,
    Post screenshots COPYABLE to a Spredsheet; NOT IMAGES PLEASE
    http://www.excelforum.com/the-water-...ml#post4109080
    https://app.box.com/s/gjpa8mk8ko4vkwcke3ig2w8z2wkfvrtv
    http://excelmatters.com/excel-forums/ ( Scrolll down to bottom )

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Do Until Loop Not Working

    This forum can be very strict about putting code inside of code tags. You risk having your topic locked if you do not comply. Instructions for using code tags are in the FAQ.

    Without a sample file, it is difficult to debug. I suspect that the "existing employees" tab is getting populated, but the results are way down on the spreadsheet (I cannot tell how many rows down it would start populating).

    Edit: A moderator fixed the code tags thing, and someone else saw the same problem with the d and j variables not being reset between loops, so there you go.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Do Until Loop Not Working

    Hello jjl287,

    Welcome to the Forum!

    The variables "d" and "j" still retains it value from the first Do loop. Reset them before starting the second Do loop.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    05-04-2014
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Do Until Loop Not Working

    Sorry about that! Worked perfectly. Thanks so much everyone!

  6. #6
    Forum Expert Doc.AElstein's Avatar
    Join Date
    05-23-2014
    Location
    '_- Germany >Outside Building things.... Mostly
    MS-Off Ver
    Office 2003 2007 2010 PC but Not mac. XP and Vista mostly, sometimes Win 7
    Posts
    3,618

    Re: Do Until Loop Not Working

    Quote Originally Posted by jjl287 View Post
    .... Worked perfectly...
    Yous welcome, gald we could 'elp
    Thanks for the feedback
    Alan

    P.s. Please mark Thread as solved

    ThreadSolved.JPG

    Edit: think you may have done it already as i posted, things move fast (sometimes ) 'ere!
    Last edited by Doc.AElstein; 10-30-2015 at 04:54 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. For loop within loop not working correctly
    By HalPlz in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-25-2015, 12:06 AM
  2. [SOLVED] For each loop not working
    By schzuki in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-31-2014, 09:54 AM
  3. [SOLVED] Do while loop not working
    By rikkyshh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2013, 01:47 PM
  4. Loop not working
    By blankus in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2009, 04:16 AM
  5. [SOLVED] Why is this Do Loop not working right?
    By evilrtc in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-21-2007, 01:52 AM
  6. Loop not working!!
    By Simon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2005, 12:05 PM
  7. [SOLVED] Do...Loop not working
    By Sunny Lin in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2005, 09:06 PM

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