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

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -