+ Reply to Thread
Results 1 to 6 of 6

When ElseIf condition is met, the statements under elseif are not happening.

  1. #1
    Registered User
    Join Date
    04-04-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    29

    Post When ElseIf condition is met, the statements under elseif are not happening.

    Please Login or Register  to view this content.
    The If statement above adds 6 and 8 weeks to Date1a and should add 18 and 24 months to Date1a, when elseif condition is met. The statements under else if are not happening.
    Can anyone please take a look at it and see if there is any errors in my code or syntax.

    Thanks,
    excelkann

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: When ElseIf condition is met, the statements under elseif are not happening.

    Are TDS and SS undeclared variables, or are they meant to be text strings, in which case you would need "TDS" and "SS".
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: When ElseIf condition is met, the statements under elseif are not happening.

    for starters what is cbo_Loc?
    Have you tried stepping through the code with F8 to see if it just skips the match condition or whether it just doesn't do what expected?
    and TDS, SS are variables in the code... if it is text then you need quotes.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Registered User
    Join Date
    04-04-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    29

    Re: When ElseIf condition is met, the statements under elseif are not happening.

    @ Arkadi and @ TMS

    Thank you both for your responses. TDS and SS are meant to be text strings. Adding "" around them has actually fixed the problem .

  5. #5
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: When ElseIf condition is met, the statements under elseif are not happening.

    Perfect, glad we could help
    Thanks for taking the time to mark the thread as solved

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: When ElseIf condition is met, the statements under elseif are not happening.

    Ditto: Glad to help.

+ 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. 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
  2. [SOLVED] If Else and ElseIf statements
    By paulary30 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-10-2013, 04:44 PM
  3. [SOLVED] VBA: Use Array instead of using ElseIf statements
    By Hudas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-18-2012, 12:44 PM
  4. If Elseif elseif problem
    By tjbillund in forum Excel General
    Replies: 3
    Last Post: 08-10-2011, 07:02 AM
  5. Ordering If, Else, and ElseIf Statements in VBA
    By BrownTeddyBear in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-07-2009, 01:51 AM
  6. if elseif
    By flow23 in forum Excel General
    Replies: 0
    Last Post: 11-14-2005, 10:15 AM
  7. [SOLVED] Re: IF..Then..ELSE.. ELSEIF
    By rjamison in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-13-2005, 08:05 PM
  8. [SOLVED] If, ElseIf
    By mast in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2005, 09:06 AM

Tags for this Thread

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