1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Need Help on Macro to compare two sheets

Discussion in 'Business Applications' started by akki_c, Sep 12, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. akki_c

    akki_c Thread Starter

    Joined:
    Jul 26, 2012
    Messages:
    13
    Hi ,

    I have data in below mentioned format in two different sheets. there are other columns as well; however, I am interested in only below mentioned values.

    Sheet-1

    ID Stages Systems
    9 Stage-1 System-1
    9 Stage-2 System-1
    9 Stage-3 System-2
    10 Stage-1 System-1
    10 Stage-5 System-2
    10 Stage-6 System-3
    11 Stage-2 System-2
    11 Stage-8 System-3
    12 Stage-3 System-1
    12 Stage-9 System-3
    13 Stage-9 System-1
    13 Stage-10 System-2
    14 Stage-1
    15 Stage-2

    Sheet-2

    ID Stages Systems
    9 Stage-1 System-1
    9 Stage-2 System-3
    9 Stage-3 System-4
    10 Stage-1 System-1
    10 Stage-5 System-2
    10 Stage-6 System-3
    11 Stage-2 System-2
    11 Stage-3 System-3
    12 Stage-3 System-1
    12 Stage-9 System-3
    13 Stage-9 System-1
    13 Stage-10 System-2
    14 Stage-1 System-1
    15 Stage-2 System-4



    1- Create new sheet, showing comparison results and copy the three columns from Sheet-1
    2- Check if the ID of Sheet-1 is available in Sheet-2
    3- If ID is available then Compare the availability of 'ID' and 'Stage' values pair of Sheet-1 in Sheet-2 . for example "9-Stage-1" and if it is available in sheet-2 give the value as "Available in both sheets" in the same row in new Status column
    4- If the 'ID' and 'Stage' values pair of Sheet-1 is not available in Sheet-2 then give the value as "Removed from Sheet-2"
    5- Similarly I want the results for 'ID' and 'System' pair as well.

    Thanks in advance,
    Akki
     
  2. 20_2_Many

    20_2_Many

    Joined:
    Jun 29, 2012
    Messages:
    518
    Please identify your Operating System and Excel version and if possible attach a copy of the workbook (with no sensitive data) here.
     
  3. akki_c

    akki_c Thread Starter

    Joined:
    Jul 26, 2012
    Messages:
    13
    Hi,

    My OS is Windows XP and Excel versin is Office 2007.

    I am unable to attach the file. How exactly I am supposed to attach the file?

    Thanks ,
    Akki
     
  4. 20_2_Many

    20_2_Many

    Joined:
    Jun 29, 2012
    Messages:
    518
    In the Reply section below, Go Advanced. The option to attach is there.
     
  5. akki_c

    akki_c Thread Starter

    Joined:
    Jul 26, 2012
    Messages:
    13
    Hi Please find the attached file.
     

    Attached Files:

  6. akki_c

    akki_c Thread Starter

    Joined:
    Jul 26, 2012
    Messages:
    13
    Hi,

    We have two sheets named 'Sheet1' and 'Sheet2' having data. and our macro should create a new sheet named 'Sheet3', which will display our analysis results in the below mentioned format.

    ID Stages Systems Stages value status for ID System value Status
    9 Stage-1 System-1 Available in both sheets Available in both sheets
    9 Stage-2 System-1 Removed from Sheet2 Available in both sheets
    9 Stage-3 System-2 Available in both sheets Available in both sheets
    10 Stage-1 System-1 Removed from Sheet2 Removed from Sheet2
    10 Stage-5 System-2 Removed from Sheet2 Removed from Sheet2
    10 Stage-6 System-3 Available in both sheets Available in both sheets
    11 Stage-2 System-2 Available in both sheet Available in both sheets
    11 Stage-8 System-3 Removed from Sheet2 Available in both sheets
    12 Stage-3 System-1 Available in both sheets Available in both sheets
    12 Stage-9 System-3 Available in both sheet Available in both sheets
    13 Stage-9 System-1 Removed from Sheet2 Removed from Sheet2
    13 Stage-10 System-2 Removed from Sheet2 Removed from Sheet2
    14 Stage-1
    15 Stage-2




    Thanks ,
    Akki
     
  7. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1068633

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice