Results 1 to 8 of 8

Thread: compare 2 sheets and extract common and error rows into another sheets

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    compare 2 sheets and extract common and error rows into another sheets

    Hope someone can help this poor newbie!

    Allow me to explain.

    I have a Excel Work Book with 2 Sheets named Caller(100 rows)and Subscriber(500 rows).
    Caller contains 2 columns: one is audio file name(with .au extension)
    and other is the content in that audio file.
    Subscriber also contains 2 columns: one is audio file name(with .au extension)
    and other is the content in that audio file.

    Now what I wish to do is to compare Caller and Subscriber and:
    To remove the common rows from Caller and Subscriber and place them in sheet3.
    To remove the rows if it satisfies any of the following error conditions and place them in sheet4:
    i)if any .au extension is missing in the column1 in both sheets
    ii)if data in column1 is same and data in column2 is different
    iii)if data in column2 is same and data in column1 is different.

    I am herewith attaching the code I was able to prepare but not able to get the exact output.

    Many thanks in advance.

    With Regards,
    Rajesh

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: compare 2 sheets and extract common and error rows into another sheets

    Quote Originally Posted by raj_thota
    Hope someone can help this poor newbie!

    Allow me to explain.

    I have a Excel Work Book with 2 Sheets named Caller(100 rows)and Subscriber(500 rows).
    Caller contains 2 columns: one is audio file name(with .au extension)
    and other is the content in that audio file.
    Subscriber also contains 2 columns: one is audio file name(with .au extension)
    and other is the content in that audio file.

    Now what I wish to do is to compare Caller and Subscriber and:
    To remove the common rows from Caller and Subscriber and place them in sheet3.
    To remove the rows if it satisfies any of the following error conditions and place them in sheet4:
    i)if any .au extension is missing in the column1 in both sheets
    ii)if data in column1 is same and data in column2 is different
    iii)if data in column2 is same and data in column1 is different.

    I am herewith attaching the code I was able to prepare but not able to get the exact output.

    Many thanks in advance.

    With Regards,
    Rajesh
    sorry but i cant see your code here
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: compare 2 sheets and extract common and error rows into another sheets

    Welcome to the Forums.

    Are you doing this in VB6 or just Excel's VBA? Re-attach your code or post it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    Lively Member
    Join Date
    Mar 2006
    Location
    Finland
    Posts
    84

    Re: compare 2 sheets and extract common and error rows into seperate sheets

    Welcome raj_thota!

    First of all: Please, don't post duplicates. You could have just made another post in your earlier thread and attached the document there.

    Second: You can post VB code between the [VBCODE ] and [/Highlight] tags.

    And then to the problem. Are you sure you're using VB6? I'm not quite sure, but that looks more like VBA. And I don't really know VBA
    And what do you mean by this, please be more specific:
    ii)if data in column1 is same and data in column2 is different
    iii)if data in column2 is same and data in column1 is different.
    I'll do my best to help you

    rade
    "Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies."
    - Linus Torvalds

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    Re: compare 2 sheets and extract common and error rows into seperate sheets

    Thank you very much Rade for taking interest,

    ii)if data in column1 is same and data in column2 is different
    iii)if data in column2 is same and data in column1 is different.

    What actually i mean is that same file name with different contents shouldnt be present in the Caller as well as Subscriber sheets. And also different files names with same content shouldnt be present.

    I hope you got what i want to convey.

    Thanks
    Rajesh

  6. #6

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    3

    Re: compare 2 sheets and extract common and error rows into another sheets

    I am doing this in VBA.
    sorry i have attached the files and posted them in a new thread.
    now, there are two threads on same topic.

    how to disable this thread. so that the flow is maintained on single thread.
    Rajesh

  7. #7
    Lively Member
    Join Date
    Mar 2006
    Location
    Finland
    Posts
    84

    Re: compare 2 sheets and extract common and error rows into seperate sheets

    Quote Originally Posted by raj_thota
    Yes Rade I am using VBA
    Rajesh
    Sorry I don't know a thing about VBA
    Hope you get help soon!

    rade
    "Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies."
    - Linus Torvalds

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: compare 2 sheets and extract common and error rows into another sheets

    Quote Originally Posted by raj_thota
    how to disable this thread. so that the flow is maintained on single thread.
    Rajesh
    Send a PM to a mod and request that the two be merged, or one of the two be deleted.

    Duplicate Threads merged and VBA question moved to Office Development.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width