Hi, Did you try "Exit for" in FOR loop where the condition is met and further looping is not required. Give it a try...It should help.
Best regards, Ayush Jain On Mar 19, 7:00 am, scubagirl <jill.brya...@gmail.com> wrote: > I have a fairly large VBA project for work - it runs a Monte Carlo > simulation on some data that is grabbed from MS Project. It takes > longer than I'd like to run - about 4 minutes for 1000 iterations, not > including writing out to Excel. I have done everything I can think of > to make it efficient: using For Each loops, declaring variables by > type, using early binding and Option Explicit... > > I know that it's not going to be super-speedy given the nature of the > project (lots of nested loops, 20x1000 arrays, etc.), but I feel like > it should run faster than it does. I've tried timing sections of it, > and with a small number of iterations, the speed is not always bad > (subsections can take .3 and 1.1 seconds to run), but as I increase > the number of iterations, it always seems to run at the worst case > (e.g., the aforementioned subsections always take 1.1 seconds to run). > Without looking at the code, does anyone have any suggestions for > things I can look into to speed up runtime? -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our Facebook Group @ http://www.facebook.com/group.php?gid=287779555678 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> HELP US GROW !! We reach over 6,800 subscribers worldwide and receive many nice notes about the learning and support from the group.Let friends and co-workers know they can subscribe to group at http://groups.google.com/group/excel-macros/subscribe To unsubscribe from this group, send email to excel-macros+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.