+ Reply to Thread
Results 1 to 16 of 16

intersection of 3 Values

  1. #1
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    intersection of 3 Values

    i have a sheet1 contain a table of information , and sheet2 the value and Result what i want to search in sheet1 , i need a macro to search values of column E sheet2 with 2nd Row of sheet1 , in the same time the value of Cell A5 in sheet2 with 1st Row of sheet1 , when these two condition exist in the same column of sheet1 i want to find the intersect with match the value of column T sheet2 with Column A sheet1. put the Result in Column U sheet2 , and Column V sheet2 equal the offset of this result ( intersection ) to the right

    please see attached file as Example
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    is there any one can help me ?
    i just want to search column that match 2 values in 2 rows ( row1 and row2 ) , then find 3rd value by Rows and get the value of intersection.
    then get the value beside this intersection one column to the right .

    please see attched file above

    thanks in advance

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: intersection of 3 Values

    Hi hassan khansa

    Try the attached. Select a Name from the Drop Down in Sheet2 Cell A5 and click the Button.
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    Dear Mr. jaslake ,
    when i select the Name from a drop Down list in cell A5 , and click the Button , it gave me Run-time error'438' : object doesn't suppot this property or method , and fill yellow the line in the code : Rng.RemoveDuplicates Columns:=Rng.Column, Header:=xlNo .
    what does it mean ?
    why you type each name of student many times in the sheet lists and not one time ?

    Note : the Result in the yellow cells are exactly the Result what i want.

    thand for your attention

  5. #5
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    also i need :

    if the No. of Exam No. in sheet2 column T not exist in Sheet1 Column A , in need the result to be the first greater than it . ie. if the Exam No. of sheet2 column T is 3 , and this No. is not exist in Sheet1 column A , want the code to search for the first greater in column A that is mean No. 4 ( or any first greater ie if No. 4 , 5 , 6 and 7 not exist in sheet1 column A , so the first greater than No. 3 is No. 8 ) .

    please see attached file again . and help me .

    Thanks

  6. #6
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    also i need :

    if the No. of Exam No. in sheet2 column T not exist in Sheet1 Column A , in need the result to be the first greater than it . ie. if the Exam No. of sheet2 column T is 3 , and this No. is not exist in Sheet1 column A , want the code to search for the first greater in column A that is mean No. 4 ( or any first greater ie if No. 4 , 5 , 6 and 7 not exist in sheet1 column A , so the first greater than No. 3 is No. 8 ) .

    please see attached file again . and help me .

    Thanks

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: intersection of 3 Values

    Hi hassan khansa

    This error
    Run-time error'438' : object doesn't suppot this property or method
    is caused by an incompatibility issue with pre 2007 Excel. I'll adjust the Code to accommodate.

    Regarding this
    also i need :
    I'm not sure my mental gymnastics stretch that far.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: intersection of 3 Values

    Hi hassan khansa

    This Code has been modified to run in pre Excel 2007 and eliminates the Run Time Error
    Please Login or Register  to view this content.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: intersection of 3 Values

    Hi hassan khansa

    I THINK the Code in the attached does this
    also i need :
    You tell me.

  10. #10
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    dear Mr.jaslake :
    thanks for your attention , the code in the last workbook you sent is working perfect , but when i copy the code to my original workbook it gives me this message Compile error: Sub or Function Not defined ), and mark the line : f = getclosest(ws1.Range(("A3"), ws1.Range("A" & Rows.Count).End(xlUp)), myExam).
    i didn't understand it , please help me .

    thanks

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: intersection of 3 Values

    Hi hassan khansa

    This is the Code that's in the attachment to my Post #9. Make certain you've copied ALL the Code, including the Function at the bottom.
    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    Thanks a lot Mr. jaslake , the code is working very perfect .
    i have just one thing , how can i edit and fix the Rng1 to be just equal to the cell L3 , and not to be all the Rows in column E (Set Rng1 = .Range(.Cells(3, 5), .Cells(.Rows.Count, 5).End(xlUp))
    thanks in advance

  13. #13
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: intersection of 3 Values

    Hi hassan khansa

    ONLY L3 or all the cells from L3 down?

  14. #14
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    just only cell L3 , instead of all cell of column E

  15. #15
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: intersection of 3 Values

    Hi hassan khansa

    Well, I'd probably rewrite the Code but you can try this...

    Change this line of Code
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.
    Note, not tested...

  16. #16
    Forum Contributor
    Join Date
    06-15-2012
    Location
    beirut
    MS-Off Ver
    Excel 2007
    Posts
    215

    Re: intersection of 3 Values

    thanks Mr jaslake for your help , the macro is working perfect .

+ 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