Is it possible to use a function in Excel 2003 to delete an entire row if it’s the same as the previous one? For example:
- apple
- apple
- plum
- vinegar
- apple
- banana
- banana
- banana
- apple
I want to delete #2, 7# and #8, but I don’t want #5 and #9 to be deleted. I want to delete a duplicated entry ONLY IF it’s the next one. I hope I managed to keep it clear to you.
If there isn’t a function, how can I do that in VBA? Thanks in advance!
Here’s something that might fit, deleting all duplicate rows (physically, not only cell data!), so keep in mind that it can be used only if you use one-column sheets. Otherwise you will loose some other data.
After running this macro for your example, I’m getting:
You can modify it, to store the values in an array, and than fill the column with remembered array instead of deleting the rows, but that should be easy now.