Good morning Marion,
Good job getting your problem sorted out. :wink:
I had looked real quick at the code in that link that Anne offered and knew it would only
delete the excess instances of the duplicate values and leave the originals, and besides,
it isn't all that efficient because it's actually selecting each cell in the column before performing
the test on its value. If there aren't many rows then it wouldn't make much difference in
speed but if you were looking at 10s of thousands of rows it would make a huge difference.
Best not to select objects in your code if you don't have to. (And we seldom ever really have to.)
As for storing your code for future applications there are a number of ways to do it
but probably the easiest to convey & understand is to simply do what you did originally,
copy it from here and paste it somewhere. (You just need to make sure it's a clean
copy/paste which is all the problem was the first time.)
When doing it this way I recommend just pasting it into a normal excel worksheet instead
of a Word doc.
Word is the devil!
(Anne, - if you're still reading this thread, I'm just kidding!
I have your book
Dreamboat on Word and use it regularly when I'm in Word.
Well written and very helpful for 'Word hacks' like me!)
I'm not sure I follow when you say you don't want to copy/paste the code every
time you want to make a run. Once you install it in a module in a workbook, (and
save) it's part of that workbook and can be run any time you want. You can slap a
button on your worksheet and assign the code to it to run with just a mouse click.
Or (if you like) I can show you how to install it so you never have to actually invoke
the code yourself, it'll just run every time there's a duplicate value entered into that columm.
Is that what you meant in your last post or am I misunderstanding?