VB to match values in two columns and throw the exact values in the 05th column

monda24

New Member
Joined
Nov 20, 2013
Messages
33
Hello,

I am looking for a Macro which can always match values with column A and reflect the similar values between column A and Column B on Column E.

So, the values in column A are always constant, these values are the standard/defualt values that we are using always to match. Column B are the new values that we paste from a new sheet. Am looking for a macro that can :

1. Remove duplicates from column B
2.Match the values in column B with column A and highlight the similar values in column B
3.Throw the similar values within A and B to column E(so, throw the highlighted values in column E)

Please let me know in case I need to upload a file.

Many thanks in advance
 
Hi

replace the code Define working ranges with this, or add "+ 1" to the 5th line

regards

Kev


Code:
'######### Define Working Ranges #########
lrA = Sheets("sheet1").Range("a1000000").End(xlUp).Row
      
RangeA = Sheets("sheet1").Range("a2:a" & lrA).Address(False, False)
lrB = Sheets("sheet1").Range("b1000000").End(xlUp).Row
      
RangeB = Sheets("sheet1").Range("B2:B" & lrB).Address(False, False)
lrE = Sheets("sheet1").Range("e1000000").End(xlUp).Row + 1
      
RangeE = Sheets("sheet1").Range("e2:e" & lrE).Address(False, False)
It is working!You rock,,Have a rocking day! Thanks a ton!:)
:)
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top