+ Reply to Thread
Results 1 to 4 of 4

If-Then Not working!

  1. #1
    Registered User
    Join Date
    04-30-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    If-Then Not working!

    I have a userform on which you can choose one of 6 options - depending on which option you choose, the selected cell is formated in a different way. I have used a If-Then series, but when I run the macro all get an error message saying "Complie error: Block If without End If". I didn't think I needed an 'End If' statement, but even if I include one I get the same error messages. The code is:

    Please Login or Register  to view this content.
    Help!!!!
    Last edited by The Bantam; 08-27-2009 at 05:31 AM.

  2. #2
    Registered User
    Join Date
    04-30-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: If-Then Not working!

    Oops sorry - forgot to click the hash! Post corrected now.

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: If-Then Not working!

    Thanks for taking the time to read and comply with the rule .

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,108

    Re: If-Then Not working!

    The way you have written it you are missing several End If statements. Assuming that only one option should ever be True, you could use:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

+ 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