TedX
Board Regular
- Joined
- Apr 18, 2021
- Messages
- 122
- Office Version
- 365
- Platform
- Windows
Hi, I have a long list of names that gets added to every day and I've formatted it so that every time a duplicate appears, the cell background colour goes
light green, sometimes they are 2 or 3 cells clumped together, and other times just one by itself. I delete the row, by selecting it and right mouse clicking to show a menu and then selecting delete. This works fine except for the following: The original entry higher in the long list, has a set of numeric values, I want to keep, whilst the lower down the list (new entry) duplicate has no value, that the one I want to delete. So I can't just use a filter to select one colour and delete because I have no control over which duplicate will be deleted, probably the highest duplicate on the list which is the exact opposite of what I want to do.
So I have no problem with selecting the duplicates down the bottom of the list and highlighting them (selecting them), except, I can only delete non-stop runs of rows to delete. In the image, I can only delete 9022 by itself, I can delete 9025 to 9027 inclusive in a single action, but I cannot select 9022 and 9025, 9026 and 9027 all at the one time and delete them. At least I can't do it via Excel directly with a mouse, I assume there is a VBA solution but I can't seem to work it out. All help would be appreciated, I suspect this is a few simple lines of VBA code using the colour 198 239 206. Thank you.
light green, sometimes they are 2 or 3 cells clumped together, and other times just one by itself. I delete the row, by selecting it and right mouse clicking to show a menu and then selecting delete. This works fine except for the following: The original entry higher in the long list, has a set of numeric values, I want to keep, whilst the lower down the list (new entry) duplicate has no value, that the one I want to delete. So I can't just use a filter to select one colour and delete because I have no control over which duplicate will be deleted, probably the highest duplicate on the list which is the exact opposite of what I want to do.
So I have no problem with selecting the duplicates down the bottom of the list and highlighting them (selecting them), except, I can only delete non-stop runs of rows to delete. In the image, I can only delete 9022 by itself, I can delete 9025 to 9027 inclusive in a single action, but I cannot select 9022 and 9025, 9026 and 9027 all at the one time and delete them. At least I can't do it via Excel directly with a mouse, I assume there is a VBA solution but I can't seem to work it out. All help would be appreciated, I suspect this is a few simple lines of VBA code using the colour 198 239 206. Thank you.