+ Reply to Thread
Results 1 to 5 of 5

IF OR statement not working as intended

  1. #1
    Registered User
    Join Date
    02-24-2019
    Location
    UK
    MS-Off Ver
    Mac & PC
    Posts
    53

    IF OR statement not working as intended

    Below is full code, but it is really only the IF OR statement I am concerned with as rest was working fine before I added this. The problem is the MsgBox always appears, so even when I have text in both TextBoxes and an item in the list box selected. I have isolated each condition and they work fine, it just seems when I introduce the OR to the code it does not work.

    Any help would be much appreciated

    Please Login or Register  to view this content.
    Last edited by AliGW; 11-27-2020 at 04:53 AM. Reason: Irrelevant content of title redacted.

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,684

    Re: IF OR statement not working as intended

    What if you reverse it?

    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Forum Expert
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    1,866

    Re: IF OR statement not working as intended

    It is a quirk that I have experienced, now rather than waste time trying to understand I just split the check.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-24-2019
    Location
    UK
    MS-Off Ver
    Mac & PC
    Posts
    53

    Re: IF OR statement not working as intended

    Thanks for the replies.

    millz - unfortunately your proposal did not seem to help.
    torachan - your suggestion to restructure was helpful and I changed it to this which now works

    Please Login or Register  to view this content.

  5. #5
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    5,216

    Re: IF OR statement not working as intended

    I imagine the issue was your typo here:

    Please Login or Register  to view this content.
    coupled with not using Option Explicit.
    Rory
    I drink, and I know things

+ 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. PowerPivot not working as intended?
    By fingerstyle in forum Excel General
    Replies: 11
    Last Post: 10-22-2017, 08:35 PM
  2. [SOLVED] Msgbox not working as intended
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-24-2013, 09:12 AM
  3. [SOLVED] VLOOKUP not working as intended
    By RAS 2112 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2013, 08:58 AM
  4. simple task i hope
    By txbob12750 in forum Excel General
    Replies: 2
    Last Post: 10-10-2012, 10:27 PM
  5. this should be simple i hope -)
    By darkbearpooh1 in forum Excel General
    Replies: 1
    Last Post: 04-06-2009, 07:53 PM
  6. Simple, I HOPE...
    By ShrOOmiEs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-09-2006, 12:12 AM
  7. macro not working as intended
    By Michael A in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-06-2005, 10:06 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