Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VBA - "End if without Block If Error"
#8
Yugidude Wrote:EDIT: just saw your Indentation mock-up of my code. You said that the 2nd "End If" is refering to code before the "For" Loop and that that was bad.. That is what I want. I only want the "For" Loop to execute if "InQuotes = False". Is thier a better way to do this?

If you only want the FOR to execute if the condition is true, you code it thus:
Code:
IF (condition) THEN
  FOR counter ...
    ....
  NEXT counter
END IF
You need to have the entire loop inside the IF - END IF block.
Reply


Messages In This Thread
VBA - "End if without Block If Error" - by Locked - 2013-04-16, 05:00 PM
VBA - "End if without Block If Error" - by FenixR - 2013-04-16, 05:04 PM
VBA - "End if without Block If Error" - by SaptaZapta - 2013-04-16, 05:27 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)