Code for Preventing Duplication

JLouis

Active Member
Joined
Jan 1, 2004
Messages
295
Office Version
  1. 365
Platform
  1. Windows
So I have a coded WB that fills out blank cells in a range when clicking on different items in a list. What I want to do is prevent the duplication of items in the list. I'm using a WS change event and need to exit the routine if I have selected an item already in the list. Please see attached.

I've tried several things but can't ever get the variables properly identified in VBA. "Object not defined" type errors. I've been trying to store each name in the list as a variable and then compare it to the active cell. value. The list only has 5 items but the list of available items is quite large.

I hope I explained this properly and thanks in advance for whatever assistance you can provide.
 

Attachments

  • Screenshot 2022-10-25 090403.png
    Screenshot 2022-10-25 090403.png
    33.9 KB · Views: 7
Who can write your macro..
After you say please...
The Candyman can...
Yes the Candyman can!

Did what you suggested and it worked perfectly. Great insight you got there.

Thanks for your help.

Louis
 
Upvote 0

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,215,833
Messages
6,127,153
Members
449,366
Latest member
reidel

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