+ Reply to Thread
Results 1 to 6 of 6

If - Then - else troubles

  1. #1
    Registered User
    Join Date
    11-17-2011
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    43

    If - Then - else troubles

    I have a loop that is checking a value in cell E2 and will cycle down column E but my if/then/else statements are giving me the "End if without Block if" error. I cannot seem to figure out why....

    what this accomplishes is it will go down column E and if it is blank, go down a cell. if there is a value, it will check to confirm that the value of the cell 4 columns to the left is "1900-0000" and if it is not, it will highlight the cell in column E.

    here is my code, any ideas?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: If - Then - else troubles

    you did not close With ActiveCell end with missing
    If solved remember to mark Thread as solved

  3. #3
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: If - Then - else troubles

    You've opened a With block, but haven't closed it, so you need and 'End With' in there before your End Ifs.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: If - Then - else troubles

    In addition you appear to have an extra End If
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: If - Then - else troubles

    Perhaps change the "End If" to "End With" as below:-
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-17-2011
    Location
    Columbus, OH
    MS-Off Ver
    Excel 2007
    Posts
    43

    Re: If - Then - else troubles

    wow i feel like a fool. Thanks guys.

+ 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