PDA

View Full Version : Solved: Comparing 2 sheets + copying data from 1 sheet to the other sheet



nether
01-05-2006, 07:20 AM
Hi guys,

I have surfed alot on the internet today, but i havent found a solution for my problem.

The problem is the following.

In a workbook I have 2 sheets. In the one sheet there is the stock which is in our accounting system. In the second sheet there is the stock which was counted manually from the stock room.

Now, i want to compare the two sheets. When comparing, the macro should first check if the itemnumber which exists in the "oracle" sheet also exists in the scan sheet. If it doesnt, it should write the line to a 3rd sheet which is created at that time.

if the item does exist in the scan sheet, then it should copy the quantity from the scanned item to the oracle sheet, behind the row of the same item iin the oracle sheet.

I know there are a lot of comparison code samples around, but i haven't found one which fits my needs yet. :banghead: (Im a beginner in VBA-programming, so thats why I posted this question here).

As a attachment i added a copy of a demo-sheet to this post. Can someone help me with this???

Thx

Rolf

austenr
01-05-2006, 10:43 AM
Have you taken a look at the MATCH and VLOOKUP functions?

austenr
01-06-2006, 09:14 AM
Is this what you want?

nether
01-06-2006, 09:40 AM
This is going on to the right direction, but if an Item exists on sheet 2, only the value for the Quantity column should be copied for each item in a new column next to the "Quantity" Column on sheet 2.

Can this be realised?

THanks a lot for your effort so far, you are making my life more easier :d
And.... also ordered a book, vba for excel for dummies ;)

Rolf

austenr
01-06-2006, 10:21 AM
Like this?

nether
01-11-2006, 05:17 AM
Hi there.

Due to your effort, i got that part working!. I copied the excelsheet with this reply, so you can see the final result.

Anyways, now i have another question. I will post that in a new thread, to keep things nice and tidy!!

Regards,

Rolf

austenr
01-11-2006, 07:13 AM
Glad it worked out for you..:hi: