+ Reply to Thread
Results 1 to 3 of 3

End if without If Block

  1. #1
    Forum Contributor
    Join Date
    01-09-2006
    Posts
    109

    End if without If Block

    I have this lovely query. There is a section with a nested if. I have a total of two ifs and two end ifs. For some reason, the compiler is saying i have an End if without an If block. I think it lies.

    Please Login or Register  to view this content.
    Of course, I must be going something wrong, but for the life of me i cannot figure out what. Perhaps it's the Gotos?

    Any advice will be greatly appreciated.

    Chris
    Last edited by cbh35711; 03-12-2012 at 04:34 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: End if without If Block

    cbh35711,

    For IF statements, when you go past the Then keyword, the compiler is expecting the then else then all on the same line, and it doesn't need an End If (which is why you're getting an error). Try it this way:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    01-09-2006
    Posts
    109

    Re: End if without If Block

    Interesting. Never knew that. Thanks!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1