+ Reply to Thread
Results 1 to 22 of 22

3 column comparison

  1. #1
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    3 column comparison

    Hello everybody,

    Although the macro works fine, but I want to modify the comparison macro. This macro only compares two columns but i want to compare two columns and when the columns are compared then it compared the corresponding column. The sample is attached with this thread with my old macro.
    Attached Files Attached Files
    Last edited by kate.middleton1; 08-19-2012 at 05:43 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Modify the current Macro

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    hi kate.middleton1, please check attachment, press "Start"
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Hello Watersev
    Thanks alot, this code works very well. Can you make the little bit change in this code that the result save always in "Sheet6" instead of adding always one sheet, because i am new in vba its hard for me to understand the code.

  5. #5
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    please check attachment
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Hello Watersev
    Your code works really very fine. Last question regarding this thread was that due to the complexity of code i am not able to change the range (by changing the position of columns only). Could you please change the range according to the workbook attach.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    please check attachment
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Yes, this is what, what i want thanks alot.

  9. #9
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    "Hello Watersev
    I have found the problem can you please take a look at the attached excel file "
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    please check attachment
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    Excel 2003 formated file
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Last changing regarding this code is that if i want to filter some other column then where i have to make the changes.

    ---------- Post added at 06:03 AM ---------- Previous post was at 05:53 AM ----------

    because here the problem i have that if i filter against the Criteria2 then it gives error.

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    I've corrected the code, filter any column and check result
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Thanks alot for your help.

  15. #15
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Hello WAtersev
    Unfortunately, i want to update this code again. The logic will remain the same with the same output results, i just now want to search the column first and then start comparison, i have written the logic in the workbook attached, i have changed it how much i can, but i have some problems please take a look at the workbook.
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    please check attachment, I assume that Tea ID column will always come first
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    and this part of the code
    Please Login or Register  to view this content.
    i think here range can also be changed?

  18. #18
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Thanks Watersev for the last code, here i had forget to say that in first column only name (Tea ID) is written somewhere in row 4 i mean "a4", so when it search then it find the name then it is written two times, so is that possible that i didnot consider the first column only for the search of Tea ID and start the criteria from second column and all rows..

  19. #19
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    please check attachment
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Thanks alot that works perfect the last problem regarding this thread was that the "Tea ID" was written in sheet 5 two times i mean in column 1 too. So that will be the perfect if it does not search the tea ID in column 1 in sheet 5.

  21. #21
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: 3 column comparison

    if I understood you correctly there is another Tea ID string in A4 on Sheet 5, this should help with that issue
    Attached Files Attached Files

  22. #22
    Forum Contributor
    Join Date
    04-13-2012
    Location
    germany
    MS-Off Ver
    Excel 2003
    Posts
    185

    Re: 3 column comparison

    Yes, exactly this is what i want. OHhhh yahoo thanks alotttttttt

+ 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