+ Reply to Thread
Results 1 to 3 of 3

Problem with do..while..until..loop

  1. #1
    Registered User
    Join Date
    05-04-2010
    Location
    Norway
    MS-Off Ver
    Excel 365
    Posts
    30

    Problem with do..while..until..loop

    Hello everyone. I hope I can get some help with this :o)

    I have made a macro that looks like this(It's a macro for accounting):

    Please Login or Register  to view this content.
    This is just an extract of the full macro, but it should be enough for me to explain.

    As you can see of the selected range, the worksheet wil now probably have the words Rent, Food and Insurance in cells B4, B5 and B6, and there is a number in cells D4, D5 and D6 which is being copied to a column farther to the right. So far the macro works. The problem is, if I then enter Rent, Food and Insurance again in cells B7, B8 and B9, and some numbers in cells D7, D8 and D9, the macro totally ignores this, and I've tried several times with do..while.until..loop, but it just doesn't work.

    Does anyone have a clue??
    Last edited by BeerKing; 05-05-2010 at 04:46 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Problem with do..while..until..loop

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    You are exiting the For Loops as soon as you find the first cell that meets the IF test.

    I would imagine you want to procress all the cells in the range so something more like this.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    03-25-2008
    MS-Off Ver
    Excel, Outlook, Word 2007/2003
    Posts
    245

    Re: Problem with do..while..until..loop

    Variation on this theme :
    Please Login or Register  to view this content.
    Charlize
    Last edited by Charlize; 05-05-2010 at 04:56 AM.

+ 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