excel - Continuing a function -
i'm trying write vba macro analyzes multiple sheets of data in same excel file. have set when it's analyzing various sheets, when finds error, stops program completely. have figured out how go next sheet cannot program continue running. here have far:
`if counter > 480 worksheets(activesheet.index + 1).select end end if`
i know end function ends running program when take out not work, how can program continue running before reaches sheet error?
put loop want end in separate function or sub, when error found, use
exit function
or
exit sub
if it's sub.
simple example using code:
sub main othersub 'continue here end sub sub othersub if counter > 480 worksheets(activesheet.index + 1).select exit sub end if end sub
Comments
Post a Comment