Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


--
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compare values in multiple sheets


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


--
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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare Sheets values in two colums Geir[_2_] Excel Worksheet Functions 1 April 7th 08 01:55 PM
How to compare multiple cell values Chirs Excel Programming 3 June 10th 05 02:03 PM
compare sheets (values and formulas), alert it like spellcheckers coco Excel Programming 3 June 3rd 05 08:22 PM
compare two cell values on different sheets sagarh Excel Programming 3 February 16th 04 01:42 PM


All times are GMT +1. The time now is 03:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"