+ Reply to Thread
Results 1 to 6 of 6

Block if without end if - please help!

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    37

    Block if without end if - please help!

    Hi,
    Could you have a look at my code below (i'm sorry very much, the code is so long).
    I can't find where the problem is, i'm getting the compile error "block if without end if".

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Block if without end if - please help!

    You have lots of "Instruction" in your macro. I can not see a macro callled "Instruction" in your workbook. That macro must be stored in a different workbook. I am assuming that you are calling a macro called "Instruction"

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Block if without end if - please help!

    Okay! You just missed "End If" just before the End of sub, so include it and the code works

  4. #4
    Registered User
    Join Date
    11-28-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Block if without end if - please help!

    I just replaced some coding with the word "instruction" for the purpose of this thread because otherwise the thread would be too long (over 10000 letters)...

  5. #5
    Registered User
    Join Date
    11-28-2012
    Location
    Copenhagen
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: Block if without end if - please help!

    Oh... you are awesome! Thank you a lot! (It's 00:30 am in Copenhagen, I am submitting the project tomorrow, You saved my job, seriously).

    I just don't understand why I need one more end if... i was counting and there is as many if's as end if's in the code....

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Block if without end if - please help!

    Shishek,
    It happens; I do it lots of times. After you sumit your project, play around with "Select Case" Instead of,as you not do lots of iffs to remember

+ 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