+ Reply to Thread
Results 1 to 3 of 3

with block with if elseif statment, else without if error

  1. #1
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    with block with if elseif statment, else without if error

    Hi,

    This macro results in an error message: "else without if" with
    Please Login or Register  to view this content.
    being highlighted. What should i change to overcome this?


    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: with block with if elseif statment, else without if error

    Add an End If

    Please Login or Register  to view this content.

    Or better yet...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 01-20-2021 at 04:42 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    02-27-2020
    Location
    Rotterdam, The Netherlands
    MS-Off Ver
    2013
    Posts
    425

    Re: with block with if elseif statment, else without if error

    Thank you, problem solved

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] When ElseIf condition is met, the statements under elseif are not happening.
    By excelkann in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-07-2016, 12:40 PM
  2. [SOLVED] If Then Elseif statment
    By CityMPLSEmpolyee in forum Excel General
    Replies: 4
    Last Post: 03-18-2014, 03:04 PM
  3. Condensing IF, ElseIF, Else statment with multiple criteria.
    By beenbee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2014, 10:44 AM
  4. Code stepping in to elseif statement when elseif is definitely not true
    By DFrank231 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-13-2013, 05:31 PM
  5. [SOLVED] Elseif function error
    By concatch in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-06-2012, 10:20 AM
  6. [SOLVED] ElseIF Statement Error
    By UsmanBPD in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-27-2012, 09:37 AM
  7. vba compile error elseif
    By UKTV2C in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-21-2011, 12:01 PM

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