MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Next Statment Without For error. But I have a For!

Posted by Chris M. on November 11, 2001 5:56 PM

I come across this sometimes. I'll write a macro and I will have a for loop all setup properly, but when I run the macro I get a "next without for error". And I can see the for right above it. Sometimes after I play with it for a while it finally goes, but I can see any noticable differance that I did to make it work. Is there anyway to make sure this doesn't happen?

Posted by Tom Urtis on November 11, 2001 6:46 PM

If you received an error and made an adjustment which then resulted in a successful code run, then you probably did change something (for the better), even if it is not immediately noticeable to you. Sometimes even a minor change can make a big difference.

If you are still having a problem with code you cannot fix, try posting an example of it so we can know what you are looking at and what exactly we should be trying to suggest a fix for.

Good luck.

Tom Urtis