+ Reply to Thread
Results 1 to 4 of 4

Keeping a count within a for next loop

  1. #1
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Keeping a count within a for next loop

    Hi

    I was wondering if anyone knows whether it is possible to add code into a for next loop which keeps a count of each next in the loop?

    I have a for next loop with an if inside it, what i need is to be able to say whenever the if is true it has something that says add 1 to the count. so when the loop starts the count is 1 and for each time the if is true it adds 1 to the count.

    Does anyone know if this is possible??

    Thank you

    kind regards

    Jeskit
    Last edited by jeskit; 02-14-2012 at 12:52 PM.

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Keeping a count within a for next loop

    Perhaps something like:

    Please Login or Register  to view this content.
    Alf

  3. #3
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Keeping a count within a for next loop

    Perhaps something like:
    Please Login or Register  to view this content.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  4. #4
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Keeping a count within a for next loop

    HI

    Thank you for replying

    Works great thank you

    Thanks!!!!!

+ 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