Link to home
Start Free TrialLog in
Avatar of Robert Kang
Robert Kang

asked on

VBA: Compare two separate excel sheets column and delete unique value Rows from sheet #2 only.(Not two sheet)

VBA: Compare two separate excel sheets column and delete unique value Rows from sheet #2 only.(Not two sheet)
Previously, I already got a perfect VBA to delete unique lows from two sheet, so Sheet#1 and sheet#2 have identical data.

Now, I need to compare two sheet and delete non matched rows from only 2nd sheet. The result is sheet #1 data does not change, sheet #2 have same or less rows.
Sheet #1 data have only 1 column in A.
Sheet #2 data have 6 columns and need to compare with B column.

Please ask any question.
Thank you.
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Why not simply copy and paste to one sheet then use the inbuilt Remove Duplicates function in the Data Tab?
Avatar of Robert Kang
Robert Kang

ASKER

Hi. Roy.
I know how to do it manually but I need to do it everyday so I need VBA, function.

Thank you anyway.
ASKER CERTIFIED SOLUTION
Avatar of Roy Cox
Roy Cox
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hello. Roy.
I was able to slove the problem using Macro recorder.
Thank you~
Glad to help.

Generally when using the Macro Recorder the code can be improved because it captures every action e.g. scrolling.  If you post it I'll take a look.