Perform Action on 2nd instance count of For Statement

  • Below is my code. I am trying to generate labels. The length of the object dictates how many objects need to be labeled, and depending on the object position, it could be labeled differently. My code works except for when I try to label the second last object. The second, and second last object need an "S" appended to the end of the label.

    The code is part of a user form and I think I altered it so that it should work in a normal worksheet.

    The second last member is labeled as V7, but it should be V7S. (It should generate labels W2 - W15, and V1S, V2 - V6, V7S)

    Any help is appreciated.

  • Re: Perform Action on 2nd instance count of For Statement

    I was able to write a work around (for those interested). I reduced the For count by 3 and wrote in a second For with a count of 3 for the three remaining labels.

    I'd still be interested to know why it wouldn't work the way I originally had it.

    Thanks for looking.

    added immediately below "Next"

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!