Stop Sheet Loop On Starting Sheet

  • how do i start this code on sheet tab "sht 12312" and stop this code on sheet tab "sht 12323." i would perfer not to use counters so that tabs may be deleted if unused inbetween 12312 and 123323.


    Code
    Dim w As Worksheet
        For Each w In ActiveWorkbook.Worksheets
            w.Activate
            gunshow
        Next w



    thanks in advance.

  • Re: Stop Code On Sheet Tab


    Like this perhaps?


    Regards,


    Wigi


    Excel MVP 2011-2014


    For more Excel memes: visit http://www.wimgielis.com ==> English articles ==> Excel memes


    -- Topics without [CODE] tags or a meaningful topic title, will be neglected by me (and probably many others as well) --

  • Re: Stop Code On Sheet Tab


    Perhaps this.

    Code
    For I = Worksheets("sht 12312").Index To Worksheets("sht 12323").Index
        Set ws = Worksheets(I)
        Msgbox ws.Name
    Next I

    Boo!:yikes:

Participate now!

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