+ Reply to Thread
Results 1 to 9 of 9

scan range and return value if adjacent cell = something

  1. #1
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Question scan range and return value if adjacent cell = something

    So I am not sure if this requires VBA or not. I wouldn't think a tool like excel would need it as I would think this is built in with index and match perhaps...but Idk for sure.

    So basically, all I would like to do is return a range or cells contents if a value next to it equals something I define like TRUE / FALSE.

    So if you look at my sample document attached, what I mean is that I would like to scan Column A and return any value in B, if column A has whatever I define (in this case TRUE / FALSE). So in this example, if true exists in column A, return column B as such.

    Does this require vba and if so how?
    Attached Files Attached Files
    Last edited by clemsoncooz; 03-20-2012 at 04:05 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: scan range and return value if adjacent cell = something

    Here you go:

    Please Login or Register  to view this content.
    Last edited by Kelshaer; 03-20-2012 at 03:21 PM.
    Regards,
    Khaled Elshaer
    www.BIMcentre.com

    Remember To Do the Following....
    1. Thank those who have helped you by clicking the Star below their post.
    2. Mark your post SOLVED if it has been answered satisfactorily:
    • Select Thread Tools (on top of your 1st post)
    • Select Mark this thread as Solved

  3. #3
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: scan range and return value if adjacent cell = something

    Thanks for the reply Kelshaer....all this seem to do was delete all the values that I would like it to return...(i.e Alpha, Beta, etc.)

  4. #4
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: scan range and return value if adjacent cell = something

    Let me describe how it works.
    it will compare the text in column A to the cells H7 and M7. if it matchs with one of them then it will return the corresponding value in the matching column starting from row 14. Just give it a try on the same file ytou attached. if you will change the values from TRUE & FALSE then you will have to change them as well in cells H7 & M7

  5. #5
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: scan range and return value if adjacent cell = something

    Ok great. That is def what I would want...but this is what happened:

    I copied you code. I right clicked on sheet name and clicked view code. I pasted it under "Sheet1(Data)" ....ran the macro and it deleted all values B4:B24.

    Perhaps it didnt delete the values, it just pasted blank values there....

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: scan range and return value if adjacent cell = something

    Please open the attached file and run the macro without changing anything
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: scan range and return value if adjacent cell = something

    ohh ok - I see....thank you! sorry for the confusion. But this is the exact opposite of what I was looking for.

    I would like H14:H25 and M14:22 to be filled out with the data set that is within B4:24....is that possible?

  8. #8
    Valued Forum Contributor
    Join Date
    08-29-2011
    Location
    Mississauga, CANADA
    MS-Off Ver
    Excel 2010
    Posts
    503

    Re: scan range and return value if adjacent cell = something

    And this will do the opposite
    Sorry for my stupidity.

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-20-2011
    Location
    United States, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    295

    Re: scan range and return value if adjacent cell = something

    Shoot - Sorry for my stupidity.

    This my friend, is just what I needed! Thank you!!!

+ 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