ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro - compare data in cols n transfer to next row (https://www.excelbanter.com/excel-programming/378342-macro-compare-data-cols-n-transfer-next-row.html)

Johnny

macro - compare data in cols n transfer to next row
 
I have about 30 columns by about 5000 rows with data already sorted by column
S (Assy Code) . I need to compare that number ex 5000-01, from column D
(Assy Code - may be in the number format XXXX, XXXX-XX, XXX€¦€¦) with column S
ex 5000-01. If that number is equal then I need to check that the number
5000-01 from column S in that row is equal to the number 5000-01 in column S
in the row below. If yes select the row with Col S and cell= 5000-01 from
column A to column L cut it and paste it in the next row with Col S and cell=
5000-01. Then go to the row after that with the number ex 600-50-1 in Column
D and start all over again.. If it is not equal move to the next row.

Ex of original data:

A B C D E F G H I J K L €¦€¦.S
i. x 1 s 5000-01 €¦€¦......€¦€¦€¦€¦€¦ 50.......€¦.5000-01
ii. 5000-01
iii.p 4 b 600-50-1 55 600-50-1
iv.c 9 s 75-000-001 6 75-000-001
v. u 15 s 79-01 250 79-01
vi. 79-01
vii a 36 b 85 66 85

Expected data
A B C D E F G H I J K L €¦€¦.S
i. 5000-01
ii. x 1 s 500-01 €¦€¦€¦€¦€¦€¦€¦ .....50€¦€¦5000-01
iii.p 4 b 600-50-1 55 600-50-1
iv.c 9 s 75-000-001 6 75-000-001
v. 79-01
vi.u 15 s 79-01 250 79-01
vii a 36 b 85 66 85

Would appreciate your help.
Thanks


John Bundy

macro - compare data in cols n transfer to next row
 
This can be done without much trouble, but I can't seem to understand exactly
what's going on with the way this this adjusts text. If you want to shoot me
some sample data I should be able to come up with something very quickly. You
can send it to take the x's out

"Johnny" wrote:

I have about 30 columns by about 5000 rows with data already sorted by column
S (Assy Code) . I need to compare that number ex 5000-01, from column D
(Assy Code - may be in the number format XXXX, XXXX-XX, XXX€¦€¦) with column S
ex 5000-01. If that number is equal then I need to check that the number
5000-01 from column S in that row is equal to the number 5000-01 in column S
in the row below. If yes select the row with Col S and cell= 5000-01 from
column A to column L cut it and paste it in the next row with Col S and cell=
5000-01. Then go to the row after that with the number ex 600-50-1 in Column
D and start all over again.. If it is not equal move to the next row.

Ex of original data:

A B C D E F G H I J K L €¦€¦.S
i. x 1 s 5000-01 €¦€¦......€¦€¦€¦€¦€¦ 50.......€¦.5000-01
ii. 5000-01
iii.p 4 b 600-50-1 55 600-50-1
iv.c 9 s 75-000-001 6 75-000-001
v. u 15 s 79-01 250 79-01
vi. 79-01
vii a 36 b 85 66 85

Expected data
A B C D E F G H I J K L €¦€¦.S
i. 5000-01
ii. x 1 s 500-01 €¦€¦€¦€¦€¦€¦€¦ .....50€¦€¦5000-01
iii.p 4 b 600-50-1 55 600-50-1
iv.c 9 s 75-000-001 6 75-000-001
v. 79-01
vi.u 15 s 79-01 250 79-01
vii a 36 b 85 66 85

Would appreciate your help.
Thanks



All times are GMT +1. The time now is 01:58 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com