+ Reply to Thread
Results 1 to 5 of 5

VBA Error: End IF without Block IF

  1. #1
    Registered User
    Join Date
    06-24-2008
    Posts
    98

    VBA Error: End IF without Block IF

    I have made this simple code which replaces an empty cell with "Empty" on a button.

    Please Login or Register  to view this content.
    But when I run it I get the error message "End IF without Block IF"

    Spreadsheet attached.
    Can anyone understand why - Can anyone help?
    Attached Files Attached Files
    Last edited by Chris424; 10-29-2008 at 07:32 AM.

  2. #2
    Registered User
    Join Date
    10-17-2006
    Location
    Belgium
    Posts
    13

    If then

    Chris,
    Use :
    Please Login or Register  to view this content.
    Eddie

  3. #3
    Registered User
    Join Date
    06-24-2008
    Posts
    98
    Quote Originally Posted by strep21 View Post
    Chris,
    Use :
    Please Login or Register  to view this content.
    Eddie
    Oh my god it was that simple! Thankyou very much!

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    Have a look at the help on "If...Then...Else Statement" to fully understand the difference between in line and block syntax of the IF statement.
    Cheers
    Andy
    www.andypope.info

  5. #5
    Registered User
    Join Date
    10-25-2008
    Location
    South East Asia
    Posts
    27
    For a single statement of If-Then Statement, End If statement is not necessary... so it should look like this instead
    Please Login or Register  to view this content.

+ 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