+ Reply to Thread
Results 1 to 7 of 7

"Multiple Loop" issue

  1. #1
    Registered User
    Join Date
    05-29-2013
    Location
    CZZ
    MS-Off Ver
    Excel 2010
    Posts
    4

    "Multiple Loop" issue

    Hello guys,

    I am quite lost, could you pls help me a little bit ? I have created simple loop but I have realized that it is not probably possible create several loops within one macro (which is caused by my bad "pseudocoding" ).

    Do you have any advice ?

    Please Login or Register  to view this content.
    What I need to do is, after below loop will finish, I need to start it again but the "lookup" will change
    to this (and once again after it will finish)

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: "Multiple Loop" issue

    It's definitely possible to have multiple loops in a sub.

    I think all you need is another variable for the 3rd argument of the lookup.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-29-2013
    Location
    CZZ
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: "Multiple Loop" issue

    Hi,
    thanks, unfortunately it did not help
    I have updated it as you have suggested and updated additional variable for the "cell", but it fills only the 8th column

    the code right now :

    Please Login or Register  to view this content.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: "Multiple Loop" issue

    How many times does the inner For loop actually run?

    What is the code actually meant to do?

  5. #5
    Registered User
    Join Date
    05-29-2013
    Location
    CZZ
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: "Multiple Loop" issue

    The code should do :

    will vlookup one values ( % which are in this column " Cells(i, 7) " ) from approx 1000 rows and will assign them to the cell, which is working :} After that, it should switch to the next cell :Cells(r, loc) +1: and insert vlookuped value from col+1

    what I need is to vlookup values from 3 different columns, which can be (hopefully) seen in attached file

    the input is variable, so I can not copy/paste it
    Macro1.xlsm

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,596

    Re: "Multiple Loop" issue

    You could do it without loops.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-29-2013
    Location
    CZZ
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: "Multiple Loop" issue

    Well,

    I have to say, that's fcking clever :}
    thanks a lot

+ 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