+ Reply to Thread
Results 1 to 3 of 3

Compare values in multiple sheets

  1. #1
    Registered User
    Join Date
    04-18-2006
    Posts
    2

    Compare values in multiple sheets

    Hello

    I am very new to VBA.
    Maybe someone can help me with some ideas or examples. The problem is this:
    I have 3 sheets :
    --- sheet1 contains item ids and prices
    --- sheet2 contains item ids and weight
    --- in sheet3 i have to add only the rows that have same value in the ids column, copying the price from the first sheet and weight from the second, and at the end sum up the prices value and the weights value

    I've searched for examples on how i can compare values in different sheets, but had no success

    If there is someone that had this problem please help me.

    Thanks a lot,
    Lucia

  2. #2
    Tom Ogilvy
    Guest

    RE: Compare values in multiple sheets

    In A1 of Sheet3 put in the formula

    =if(countif(Sheet2!A:A,Sheet1!A1)>0,A1,na())
    then drag fill down the column until you get to the last row that has values
    in Sheet1.

    select column 1 of sheet1 and do Edit=>copy, then immediately Edit=>Paste
    special and select values.
    With column 1 still selected do
    edit=>Goto=>special and select constants and errors

    Do edit =>Delete and select entire row

    In Sheet3
    now go to B1 and put in
    =vlookup(A1,Sheet1!$A$1:$B$50,2,False)

    in C1 put in
    =Vlookup(A1,Sheet2!$A$1:$B$50,2,false)
    select B1:C1 and drag fill down the column.

    Select Columns C and B and do edit=>copy, then edit=>Paste Special and
    select values.

    I assume you can do the rest.

    --
    Regards,
    Tom Ogilvy


    "marcu_lucia" wrote:

    >
    > Hello
    >
    > I am very new to VBA.
    > Maybe someone can help me with some ideas or examples. The problem
    > is this:
    > I have 3 sheets :
    > --- sheet1 contains item ids and prices
    > --- sheet2 contains item ids and weight
    > --- in sheet3 i have to add only the rows that have same value in
    > the ids column, copying the price from the first sheet and weight from
    > the second, and at the end sum up the prices value and the weights
    > value
    >
    > I've searched for examples on how i can compare values in different
    > sheets, but had no success
    >
    > If there is someone that had this problem please help me.
    >
    > Thanks a lot,
    > Lucia
    >
    >
    > --
    > marcu_lucia
    > ------------------------------------------------------------------------
    > marcu_lucia's Profile: http://www.excelforum.com/member.php...o&userid=33592
    > View this thread: http://www.excelforum.com/showthread...hreadid=533712
    >
    >


  3. #3
    Registered User
    Join Date
    04-18-2006
    Posts
    2

    Thanks, problem solved

    hello again,


    thanks for your help. i managed to solve the problem using the vlookup function.


    I'm greatful for your help and please excuse the long time until i replied.


    Lucia

+ 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