Sample:
[TABLE="width: 430"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Comments[/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]aaaaa[/TD]
[TD]bbbbb[/TD]
[TD]ccccc[/TD]
[TD]ddddd[/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]eeeee[/TD]
[TD]fffff[/TD]
[TD]ggggg[/TD]
[TD]hhhhh[/TD]
[/TR]
[TR]
[TD]103[/TD]
[TD]jjjjj[/TD]
[TD]kkkkk[/TD]
[TD]lllll[/TD]
[TD]zzzzz[/TD]
[/TR]
[TR]
[TD]157[/TD]
[TD]xxxxx[/TD]
[TD]ccccc[/TD]
[TD]vvvvv[/TD]
[TD]bbbbb[/TD]
[/TR]
[TR]
[TD]133[/TD]
[TD]nnnnn[/TD]
[TD]mmmmm[/TD]
[TD]qqqqq[/TD]
[TD]wwwww[/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]eeeee[/TD]
[TD]fffff[/TD]
[TD]ggggg[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]aaaab[/TD]
[TD]bbbbb[/TD]
[TD]ccccc[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]157[/TD]
[TD]xxxxx[/TD]
[TD]ccccc[/TD]
[TD]vvvvv[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]133[/TD]
[TD]nnnnn[/TD]
[TD]mmmmm[/TD]
[TD]qqqqq[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]122[/TD]
[TD]aaabb[/TD]
[TD]bbbcc[/TD]
[TD]cccdd[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What it should look like at the end:
[TABLE="width: 686"]
<tbody>[TR]
[TD][TABLE="width: 430"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Comments[/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]aaaab[/TD]
[TD]bbbbb[/TD]
[TD]ccccc[/TD]
[TD]ddddd[/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]eeeee[/TD]
[TD]fffff[/TD]
[TD]ggggg[/TD]
[TD]hhhhh[/TD]
[/TR]
[TR]
[TD]103[/TD]
[TD]jjjjj[/TD]
[TD]kkkkk[/TD]
[TD]lllll[/TD]
[TD]zzzzz[/TD]
[/TR]
[TR]
[TD]157[/TD]
[TD]xxxxx[/TD]
[TD]ccccc[/TD]
[TD]vvvvv[/TD]
[TD]bbbbb[/TD]
[/TR]
[TR]
[TD]133[/TD]
[TD]nnnnn[/TD]
[TD]mmmmm[/TD]
[TD]qqqqq[/TD]
[TD]wwwww[/TD]
[/TR]
[TR]
[TD]122[/TD]
[TD]aaabb[/TD]
[TD]bbbcc[/TD]
[TD]cccdd[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Hi Guys,
I really hope someone can help. I am just starting to learn VB but as I have very little time to study it would probably take a few months before I could write the code. This could be very difficult or very simple. Not quite sure.
What I need:
1st compare all numbers in Column A beginning with A2 and if number appears again further down copy all the information from that row into relevant Columns where the first number was
It's easier with an example: Cell A2 has the number 101 in it. Now we need to check A3, A4 A5 etc to see if the number 101 appears again. It does so in Cell A8. Now I would need the Info contained in B8 copied to B2, C8 to C2, D8 to D2. The information in the E column (Comments) should not be overwritten so no copying E8 to E2 is necessary. After that is done complete ROW 8 should be deleted.
Then A3 which contains number 105 should be checked for a another A column that also contains 105. It does so in A7 and we again copy all the info from that this row to Row 3. Once again ignoring the Comment Column . After all the info is copied Row 7 can be deleted.
That needs to be continued for all the other numbers in Column A until there are no numbers left.
There are some circumstances where a number in Column A is there only once. Eg. Cell A4 contains number 103 and there is no other number 103 anywhere in Column A. If that happens the row should be marked all red (or highlighted in some other way) so I can check that particular number manually.
That case also happens for cell A11 that has number 122 which also appears only once. Again that whole column would need to be marked somehow (either color or any other feature) so I can look at that one manually.
You can see what it should look like at the end in my sample.
Here is some additional info:
This is all very simplified. There are many more rows and columns than this but usually I can adjust the code depending on the amount of columns /rows. There are usually no more than 200 rows though.
The columns contain different data sets such as numbers, dates and formulas. Not sure if that makes any difference when copying data from one row to another.
Sometimes there are no changes at all or everything changed.
The most amount of matching numbers are 2. Never more but sometimes there is only a single number as explained above.
[TABLE="width: 430"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Comments[/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]aaaaa[/TD]
[TD]bbbbb[/TD]
[TD]ccccc[/TD]
[TD]ddddd[/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]eeeee[/TD]
[TD]fffff[/TD]
[TD]ggggg[/TD]
[TD]hhhhh[/TD]
[/TR]
[TR]
[TD]103[/TD]
[TD]jjjjj[/TD]
[TD]kkkkk[/TD]
[TD]lllll[/TD]
[TD]zzzzz[/TD]
[/TR]
[TR]
[TD]157[/TD]
[TD]xxxxx[/TD]
[TD]ccccc[/TD]
[TD]vvvvv[/TD]
[TD]bbbbb[/TD]
[/TR]
[TR]
[TD]133[/TD]
[TD]nnnnn[/TD]
[TD]mmmmm[/TD]
[TD]qqqqq[/TD]
[TD]wwwww[/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]eeeee[/TD]
[TD]fffff[/TD]
[TD]ggggg[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]aaaab[/TD]
[TD]bbbbb[/TD]
[TD]ccccc[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]157[/TD]
[TD]xxxxx[/TD]
[TD]ccccc[/TD]
[TD]vvvvv[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]133[/TD]
[TD]nnnnn[/TD]
[TD]mmmmm[/TD]
[TD]qqqqq[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]122[/TD]
[TD]aaabb[/TD]
[TD]bbbcc[/TD]
[TD]cccdd[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
What it should look like at the end:
[TABLE="width: 686"]
<tbody>[TR]
[TD][TABLE="width: 430"]
<tbody>[TR]
[TD]Column A[/TD]
[TD]Column B[/TD]
[TD]Column C[/TD]
[TD]Column D[/TD]
[TD]Comments[/TD]
[/TR]
[TR]
[TD]101[/TD]
[TD]aaaab[/TD]
[TD]bbbbb[/TD]
[TD]ccccc[/TD]
[TD]ddddd[/TD]
[/TR]
[TR]
[TD]105[/TD]
[TD]eeeee[/TD]
[TD]fffff[/TD]
[TD]ggggg[/TD]
[TD]hhhhh[/TD]
[/TR]
[TR]
[TD]103[/TD]
[TD]jjjjj[/TD]
[TD]kkkkk[/TD]
[TD]lllll[/TD]
[TD]zzzzz[/TD]
[/TR]
[TR]
[TD]157[/TD]
[TD]xxxxx[/TD]
[TD]ccccc[/TD]
[TD]vvvvv[/TD]
[TD]bbbbb[/TD]
[/TR]
[TR]
[TD]133[/TD]
[TD]nnnnn[/TD]
[TD]mmmmm[/TD]
[TD]qqqqq[/TD]
[TD]wwwww[/TD]
[/TR]
[TR]
[TD]122[/TD]
[TD]aaabb[/TD]
[TD]bbbcc[/TD]
[TD]cccdd[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Hi Guys,
I really hope someone can help. I am just starting to learn VB but as I have very little time to study it would probably take a few months before I could write the code. This could be very difficult or very simple. Not quite sure.
What I need:
1st compare all numbers in Column A beginning with A2 and if number appears again further down copy all the information from that row into relevant Columns where the first number was
It's easier with an example: Cell A2 has the number 101 in it. Now we need to check A3, A4 A5 etc to see if the number 101 appears again. It does so in Cell A8. Now I would need the Info contained in B8 copied to B2, C8 to C2, D8 to D2. The information in the E column (Comments) should not be overwritten so no copying E8 to E2 is necessary. After that is done complete ROW 8 should be deleted.
Then A3 which contains number 105 should be checked for a another A column that also contains 105. It does so in A7 and we again copy all the info from that this row to Row 3. Once again ignoring the Comment Column . After all the info is copied Row 7 can be deleted.
That needs to be continued for all the other numbers in Column A until there are no numbers left.
There are some circumstances where a number in Column A is there only once. Eg. Cell A4 contains number 103 and there is no other number 103 anywhere in Column A. If that happens the row should be marked all red (or highlighted in some other way) so I can check that particular number manually.
That case also happens for cell A11 that has number 122 which also appears only once. Again that whole column would need to be marked somehow (either color or any other feature) so I can look at that one manually.
You can see what it should look like at the end in my sample.
Here is some additional info:
This is all very simplified. There are many more rows and columns than this but usually I can adjust the code depending on the amount of columns /rows. There are usually no more than 200 rows though.
The columns contain different data sets such as numbers, dates and formulas. Not sure if that makes any difference when copying data from one row to another.
Sometimes there are no changes at all or everything changed.
The most amount of matching numbers are 2. Never more but sometimes there is only a single number as explained above.