We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Keep getting 'Next Without For' error in VB Excel even when they match up fine!

I've written a very simple program in VB Excel containing a For loop.

When I run the macro it says 'Compile error: Next without For'.

There is only one For loop and there is one 'For' and one 'Next'.

I cannot see why it would complain - it is a very simple program and all other structures are in place i.e End If etc

I have noticed this error has come up far more since switching over to Excel 2003.

I hardly ever used to get this error with 2000 despite writing more complicated macros.

I'm going nuts over this problem.

Hope someone can help.


Thanks

L
"To be ignorant of one's ignorance is the malady of the ignorant." Amos Bronson Alcott

Comments

  • Tony_H_3
    Tony_H_3 Posts: 2,644
    Part of the Furniture 1,000 Posts Combo Breaker
    Forumite
    Can you paste the code (PM) me if you would prefer not to share it.
  • MarkyMarkD
    MarkyMarkD Posts: 9,913
    Part of the Furniture 1,000 Posts Combo Breaker
    Forumite
    Ditto - I'd gladly help if you posted or PM'd the code.
  • Tony_H_3
    Tony_H_3 Posts: 2,644
    Part of the Furniture 1,000 Posts Combo Breaker
    Forumite
    Something tell's me you've exploited the bank holiday weekend!! Or we'll receive the code in 13 week's as your name is Maxwell and you are a current resident of BB6 icon7.gif
This discussion has been closed.
★ ★ ★ Meet your Ambassadors

Categories

  • All Categories
  • 356K Banking & Borrowing
  • 255K Reduce Debt & Boost Income
  • 456.3K Spending & Discounts
  • 248.5K Work, Benefits & Business
  • 606.3K Mortgages, Homes & Bills
  • 179.1K Life & Family
  • 264.1K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.2K Discuss & Feedback
  • 37.7K Read-Only Boards
Quick Search

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.