+ Reply to Thread
Results 1 to 1 of 1

Call macro if specific text is within listbox

  1. #1
    Registered User
    Join Date
    06-30-2011
    Location
    Los Angeles, California
    MS-Off Ver
    Excel 2003
    Posts
    5

    Call macro if specific text is within listbox

    Please Login or Register  to view this content.
    I have a Userform with a ListBox, Command Button, and some Textboxes. I want to create a code that when activated will check ListBox5 for string “Far Above”, string “Long Way Below”, and string “Extreme Distance” only.

    If one, two, or all three of these strings are the only strings in ListBox5 and no other strings are present, then I would like to call macro “AlternativeOne”. If one, two, or all three of these strings are present in ListBox5 but additional strings are present, then I would like to call macro “AlternativeTwo”. If none of these strings are present but additional strings are present then I would like to also call macro “AlternativeTwo”.

    Presently the code works as long as all 3 strings are in ListBox5. However if ListBox5 has only two of these strings or only one of these strings the code does not work. I am looking for help so it works if If one, two, or all three of these strings are present not just all three. Can you help me?
    Last edited by EthanM; 07-02-2011 at 12:51 PM.

+ 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