+ Reply to Thread
Results 1 to 6 of 6

Range search two conditions - Bananas and Oranges!

  1. #1
    Registered User
    Join Date
    12-08-2015
    Location
    Earth
    MS-Off Ver
    Excel 2013
    Posts
    9

    Range search two conditions - Bananas and Oranges!

    Hi I'm trying to figure out a way to make this code execute my range search. Im intrested to know if my Range ( S:column) contains Banana1 or Orange2 or if the range contains both Banana1 or Orange 2. Furthermore if Banana1 or Orange2 is found I store the row number which contains Banana1 or Orange2 ( in S198 or S230 for example. Finally I also mark each case if true x=1 if range contain Banana1, x2=2 if range contain Orange2 and x3 if range contains both.

    Well....It doesnt work and I would like some guidance.

    Grateful for any help!

    Kind regards,




    Please Login or Register  to view this content.

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    861

    Re: Range search two conditions - Bananas and Oranges!

    Hi there! I don't know the use of this but you could write it like this:

    Please Login or Register  to view this content.
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Range search two conditions - Bananas and Oranges!

    Submit an example workbook
    If you are happy with my response please click the * in the lower left of my post.

  4. #4
    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,461

    Re: Range search two conditions - Bananas and Oranges!

    I don't know or understand the purpose of your code, but this is syntactically correct:

    Please Login or Register  to view this content.
    This isn't possible:

    Please Login or Register  to view this content.

    Maybe it should be "Or", not "And"?


    Regards, TMS
    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


  5. #5
    Registered User
    Join Date
    12-08-2015
    Location
    Earth
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: Range search two conditions - Bananas and Oranges!

    Thank all of you for your suggestions. Both methods works but after some time evaluating I decided to go for TMS solution. Seems to be a glitch in the forum since I cannot give TMS "Reputation" as well

  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,461

    Re: Range search two conditions - Bananas and Oranges!

    You're welcome

    Seems to be a glitch in the forum since I cannot give TMS "Reputation" as well
    It's just because you've recently given me +rep and you can't "keep" giving the same person +rep. After you've repped others, it will be allowed again

    Kind regards, TMS

+ 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. Search many conditions
    By shimaa01234 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-06-2015, 09:44 AM
  2. Apples and Oranges Counting Mystery using Excel ?
    By mbwatersuk in forum Excel General
    Replies: 4
    Last Post: 02-03-2015, 02:56 PM
  3. Search function in VBA with conditions
    By Ruandi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2013, 10:36 AM
  4. Replies: 6
    Last Post: 01-26-2012, 10:02 PM
  5. search through a list with 2 conditions
    By mackinlay in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2008, 10:16 AM
  6. Apples and Oranges = Time and Production
    By ComcoDG in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-06-2008, 06:00 PM
  7. Apples, Bananas, Oranges -- Can Excel Spit Out the Highest?
    By AnnieHall25 in forum Excel General
    Replies: 2
    Last Post: 05-02-2007, 08:24 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