• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Compares two different columns in two sheets and returns the differences.

MOFARA

New Member
I’m working on a function in VBA that compares two different columns in two sheets and returns the differences.
For example, for each Stock No in Sheet1 (Master Stock) in column E is compared with each Stock No in Sheet2 (New Stock No) column C.
Then, the code loop and checks each value in column C (Sheet2) with each value in Column E (Sheet1).
Then, New Stock No. from Sheet2 (missing from sheet1) to be add it in column, E in Sheet1, in the last empty cell.
Thanks.
 

Attachments

vletm

Excel Ninja
MOFARA
While try to start this ...
few comments ...
#1 Sheet1 is empty
#2 There is no Sheet2
#3 columns C & E ...

Did You upload a correct file?
Ideas?
 

MOFARA

New Member
Hi ,
Thanks for the replay, Yes you are right.
#1 Sheet1 is empty, Yes, It is Not required only Master sheet Column E,
#2 There is no Sheet2, Yes, It is only the new Stock sheet Column C,
#3 columns C & E, Yes, E to be the Master updated with the new Stock No from E at the last empty cell.
Thanks.
 

Marc L

Excel Ninja
Before and expected result workbooks - respecting real layout - make your need easier to foresee for any helper …​
 

MOFARA

New Member
Hi vletm,
To make it simple, I'm trying to compare the Stock No in the new Stock Sheet with the Master Sheet, if there is new Stock No's, add them to the Master Sheet, else Nothing. The Master sheet layout is different required to look from E8 to to the last Cell in Column E. The new Stock Sheet required to look from C17 to the last Cell in Column C. then copy the missing or new Stock No the Master Sheet in the bottom in Column C . hope this make it easier. Appreciate you help.
 

Nebu

Excel Ninja
Hi:

May be try this using power query. I have only done couple of test, seems to be working fine. Test it with more data before you implement.

Thanks
 

Attachments

Top