macro - compare data in cols n transfer to next row

J

Johnny

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
 
J

John Bundy

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 (e-mail address removed) take the x's out
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top