+ Reply to Thread
Results 1 to 5 of 5

How can I add a condition in my loop that does not work?

  1. #1
    Registered User
    Join Date
    01-08-2021
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    7

    How can I add a condition in my loop that does not work?

    Hey folks!

    I've a problem with my code, basically this loop distribute a known number evenly 1 by 1 across a range where the known number is given by "TV Comodin" Row (in color Red) until the rows reach to 100 (limit) or the known number reach to 0 , the data set is as follow:

    Captura.PNG

    My code works, it identify the minimum value and then distribute the known number evenly 1 by 1 across the range, and once the known number reach to 100 or the known number gets to 0 it stops, the problem here is that the loop just should be adding the number 1 by 1 and stopping when it finish in the rows with the AB Category (given by the "SEGMENT" column ") . When I try to add this rule, it just not works and keeps adding the number in all the rows along the range, here is my try:

    Please Login or Register  to view this content.
    the desired out put would be:

    Sin título.png

    any idea? hope you can help me guys, thanks ( I attached the data set, )
    Attached Files Attached Files

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,900

    Re: How can I add a condition in my loop that does not work?

    Hi to you too,
    Honestly, I don't understand at all what you're trying to achieve.
    In your language: "Manito, no entiendo ni pitos y falutas de lo que querés hacer"
    I'll try rereading it and download the file too to see how far I get, but, paciencia please
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    01-08-2021
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    7

    Re: How can I add a condition in my loop that does not work?

    I think it's pretty clear, "pendejito", but no worries about it, friendly people in another forum helped me already. So in your language "I don't need you, dude". By the way "querés" and "falutas" are not even words in spanish, thanks

  4. #4
    Registered User
    Join Date
    01-08-2021
    Location
    Mexico
    MS-Off Ver
    2013
    Posts
    7

    Re: How can I add a condition in my loop that does not work?

    Quote Originally Posted by xxkid View Post
    I think it's pretty clear, "pendejito", but no worries about it, friendly people in another forum helped me already. So in your language "I don't need you, dude". By the way "querés" and "falutas" are not even words in spanish, thanks
    I think it's pretty clear, "pendejito", but no worries about it, friendly people in another forum helped me already. So in your language "I don't need you, dude". By the way "querés" and "falutas" are not even words in spanish, thanks

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,960

    Re: How can I add a condition in my loop that does not work?

    xxkid.

    1. Verbal abuse will NOT be tolerated here.

    2.Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. No further help to be offered until the link is provided.)
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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. [SOLVED] Add a blank row after the loop done the work and run the loop from the next row
    By IonutC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2016, 04:31 AM
  2. Skip in loop if condition in loop is met
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-17-2015, 10:41 AM
  3. VBA Code for populating cells from one Work Book A to another Work Book with condition
    By ray.kanata in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-22-2015, 03:46 PM
  4. Multiple Condition Do Loop
    By redpanda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2011, 02:29 PM
  5. Loop until condition is met
    By Toimia in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-08-2011, 08:39 PM
  6. Add a second condition to loop
    By Casey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2006, 07:00 PM
  7. Using For loop to condition
    By bundyloco in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2005, 03:05 PM

Tags for this Thread

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