VBA to look for duplicate item in another worksheet upon data entry

DUMMY1

New Member
Joined
Feb 25, 2016
Messages
9
Hello,

1. I have two worksheets in a workbook both containing same item (PART#).
2. Sheet 1 - Master List
3. Sheet 2 - Data Input
4. After data input (PART#) in Sheet 2, VBA will search for identical PART# in Sheet 1.
5. VBA will prompt an input message "Duplicate PART# found! Do you want to delete (Y/N)?"
6. If yes, VBA will delete entire row having the identical PART# in Sheet 1.
7. In the same token, the row containing the new PART# in Sheet 2 will also be removed.

I have been working on this for two weeks (with or without VBA) but nothing has worked. Could someone please help?

Thanks!.

DUMMY 1
 
Hi Joe,

The run-time error was caused by some protected columns in SHEET 2. I added on ActiveSheet.Unprotect Password:= and the codes are working fine now.

Thanks a lot!
You are welcome - thanks for the reply.

Always a good idea to let us know details like "sheet is protected" in your initial post.
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,224,829
Messages
6,181,219
Members
453,024
Latest member
Wingit77

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