Home |
Search |
Today's Posts |
#21
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Monday, October 8, 2012 8:06:42 AM UTC-7, joeu2004 wrote:
Caveat.... I wrote: Previously, you stated that you identify duplicates by using an Excel 2010 Duplicate conditional format, then manually marking "X" next to columns that are colored (duplicates). Pay close attention to the details of any proposed solution, especially mine. I just realized there are other interpretations of "move duplicates" that would have very different results. I could easily tweak my solutions to accommodate these other interpretations. I just need to know precisely what your requirements are. Let's do this by example. If the following examples are insufficient, please embellish them with examples of your own. (Sigh, I should have asked for this at the outset instead of making assumptions.) ----- Suppose your data are as follows: E17: 3 F17: a E18: 2 F18: b E19: 1 F19: c E20: 3 F20: a E21: 1 F21: c Which result do you want (if neither, what do you want)? (1a) what my solutions create: C17: 3 D17: a E17: 3 F17: a C18: 1 D18: c E18: 2 F18: b ---- - ---- - E19: 1 F19: c All duplicates __except__ the first appearance are moved to the left. (1b) alternatively: C17: 3 D17: a E17: 2 F17: b C18: 3 D18: a C19: 1 D19: c C20: 1 D20: c __All__ duplicates are moved to the left. ----- And while we're at it, what defines a "duplicate"? Suppose your data are as follows: E17: 3 F17: a E18: 2 F18: a E19: 1 F19: b E20: 3 F20: c E21: 1 F21: b (2a) what my solutions create: C17: 1 D17: b E17: 3 F17: a ---- - ---- - E18: 2 F18: a ---- - ---- - E19: 1 E19: b ---- - ---- - E20: 3 F20: c Duplicates based on __both__ columns E and F. (2b) alternative: C17: 3 D17: c E17: 3 F17: a C18: 1 D18: b E18: 2 F18: a ---- - ---- - E19: 1 F19: b Duplicates are based on column E only. (2c) alternative: C17: 2 D17: a E17: 3 F17: a C18: 1 D18: b E18: 1 F18: b ---- - ---- - E19: 3 F19: c Duplicates are based on column F only. (2d) alternative: C17: 2 D17: a E17: 3 F17: a C18: 1 D18: b E18: 1 F18: b C19: 3 D19: c Duplicates are based on column E __or__ column F. Hi joeu Defining a duplicate. For my purpose the three XXOO in E17,18,19 are duplicates as are the two XOOX in E20, 21. Column F does not come into play determining a duplicate. (The XOOX in E22 & SEEK in F22 would be an outright typo mistake made during data entry. I believe we can disregard that entry, I show it only to eliminate it as being considered as a dupe in the solution process.) Regarding vba case-sensitive, all data is upper case. My "make-a-wish" ultimate solution would be this: * E22 & F22 Not considered. E F 17 XXOO YELL 18 XXOO TELL 19 XXOO LESS 20 XOOX KEEP 21 XOOX SEEK 22 XOOX SEEK* A B C D E F XXOO TELL XXOO LESS XXOO YELL XOOX SEEK XOOX KEEP Non-dupes remain in cols E & F. Regards, Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Fast code in 2003 = agonizingly slow code in 2007 | Excel Programming | |||
Run VBA code only worksheet change, but don't trigger worksheet_change event based on what the code does | Excel Programming | |||
Issue with code execution -- it is very slow | Excel Programming | |||
Code issue - before_save() - Filename with date stamp - worksheet | Excel Programming | |||
Slow code when used as VBA code instead of macro (copying visible columns) | Excel Programming |