donlincolnmre2
Board Regular
- Joined
- Dec 23, 2006
- Messages
- 142
Hello
I’m looking for a macro to MOVE only PHONE NUMBERS from the row below (CHILD RECORD which appears several times in some cases) to the row above (MASTER RECORD)
The top row (or the first occurrence of the record) contains the master record and it has columns range of from A to BB
The child records rows have lots less columns.
The macro should count how many times the CHILD Record appear and copy the MASTER RECORD that many time and then MOVE the PHONE NUMBERS from the CHILD record into the MASTER RECORD (only the PHONE NUMBERS)
The address appears in COLUMN F and the PHONE NUMBERS in COLUMN J
The only way I can think of is to focus on COLUMN F and compare row by row and look for equal address match, once found then count how many time it appeared and then copy the master that many time (entire row) and then MOVE the numbers from child record in to master.
If there is no duplicate address for the record then it should just delete the entire row.
e.g. 762 morita only appeared once so that one should be deleted
7619 kengard the 1st record is the master record so the number should be MOVED from the row below
761 TERMINAL the CHILD RECORD appeard 6 times, so the master record (the entire row) should have a total of 6 copies and then MOVE the phone number from the CHILD RECORD.
Any help would be greatly appreciated
Thanks.
Here is the DUMMY DATA.
=====================
Data shows 5 columns
Column F=address
Column g=city state zip
Column h=state
Column I=zip
Column j=phone numbers
762 MORITA DR CORONA CA 92879 744-A2
7619 KENGARD AVE WHITTIER CA 90606 677-A7
7619 KENGARD AVE Whittier, Ca 90606-2440 CA 591000 5623258331
761 TERMINAL ST Los Angeles, Ca 90021-1121 CA 90605 707-G2
761 TERMINAL ST Los Angeles, Ca 90021-1121 CA 374381 2136238560
761 TERMINAL ST Los Angeles, Ca 90021-1121 CA 374381 2136247415
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2134880271
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2135720121
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2136231810
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2136275045
7607 S HALLDALE AVE LOS ANGELES CA 90047 703-J1
7607 S HALLDALE AVE Los Angeles, Ca 90047-2516 CA 450000 3237511636
7606 YANKEY ST DOWNEY CA 90242 705-H6
7605 TEA BERRY WAY SACRAMENTO CA 95828 338-F3
7605 NORTHEAST CIR CITRUS HEIGHTS CA 95610 259-H6
7604 WINDSONG PL RANCHO CUCAMONGA CA 91730 573-B7
7601 LEHIGH PL WESTMINSTER CA 92683 827-J4
7601 LEHIGH PL Westminster, Ca 92683-6200 CA 517000 7148943591
I’m looking for a macro to MOVE only PHONE NUMBERS from the row below (CHILD RECORD which appears several times in some cases) to the row above (MASTER RECORD)
The top row (or the first occurrence of the record) contains the master record and it has columns range of from A to BB
The child records rows have lots less columns.
The macro should count how many times the CHILD Record appear and copy the MASTER RECORD that many time and then MOVE the PHONE NUMBERS from the CHILD record into the MASTER RECORD (only the PHONE NUMBERS)
The address appears in COLUMN F and the PHONE NUMBERS in COLUMN J
The only way I can think of is to focus on COLUMN F and compare row by row and look for equal address match, once found then count how many time it appeared and then copy the master that many time (entire row) and then MOVE the numbers from child record in to master.
If there is no duplicate address for the record then it should just delete the entire row.
e.g. 762 morita only appeared once so that one should be deleted
7619 kengard the 1st record is the master record so the number should be MOVED from the row below
761 TERMINAL the CHILD RECORD appeard 6 times, so the master record (the entire row) should have a total of 6 copies and then MOVE the phone number from the CHILD RECORD.
Any help would be greatly appreciated
Thanks.
Here is the DUMMY DATA.
=====================
Data shows 5 columns
Column F=address
Column g=city state zip
Column h=state
Column I=zip
Column j=phone numbers
762 MORITA DR CORONA CA 92879 744-A2
7619 KENGARD AVE WHITTIER CA 90606 677-A7
7619 KENGARD AVE Whittier, Ca 90606-2440 CA 591000 5623258331
761 TERMINAL ST Los Angeles, Ca 90021-1121 CA 90605 707-G2
761 TERMINAL ST Los Angeles, Ca 90021-1121 CA 374381 2136238560
761 TERMINAL ST Los Angeles, Ca 90021-1121 CA 374381 2136247415
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2134880271
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2135720121
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2136231810
761 TERMINAL ST Los Angeles, Ca 90021-1100 CA 374381 2136275045
7607 S HALLDALE AVE LOS ANGELES CA 90047 703-J1
7607 S HALLDALE AVE Los Angeles, Ca 90047-2516 CA 450000 3237511636
7606 YANKEY ST DOWNEY CA 90242 705-H6
7605 TEA BERRY WAY SACRAMENTO CA 95828 338-F3
7605 NORTHEAST CIR CITRUS HEIGHTS CA 95610 259-H6
7604 WINDSONG PL RANCHO CUCAMONGA CA 91730 573-B7
7601 LEHIGH PL WESTMINSTER CA 92683 827-J4
7601 LEHIGH PL Westminster, Ca 92683-6200 CA 517000 7148943591