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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,223,740
Messages
6,174,223
Members
452,552
Latest member
Kleets

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