Dr Jones wrote:
[snip]
Basically I have this data for example formatted like this
A B C
1 1 2 SAMPLE1
2 2 5 SAMPLE2
3 3 6 SAMPLE3
4 4
5 5
6 6
I want to be able to align Column B's numbers with those in A and take
C along for the ride.
Ok, the sample data you gave looked like so.
A B C
1 1 2 SAMPLE1
2 2 5 SAMPLE2
3 3 6 SAMPLE3
4 4
5 5
6 6
I'm *guessing* you meant it to look like so.
A B C
1 2 SAMPLE1
2 5 SAMPLE2
3 6 SAMPLE3
4
5
6
That is, the first column of 1, 2, etc. is really the row numbers.
And I'm also *guessing* (from reading downthread) you want to
know how to get it to look like so.
A B C
1
2 2 SAMPLE1
3
4
5 5 SAMPLE2
6 6 SAMPLE3
If that's it, and if I were doing it, I would be writing some VBA to do
it.
The steps would look like so:
- Move cols B and C to a temp worksheet, still in cols B and C.
(Saves having to worry about moving and copying onto places
that may have data already.)
- Sort cols B and C on col B.
- Check for duplicates in col B. Check for values out of range in col
B.
Decide what to do if these conditions appear.
- Scan down col A here and col B on the temp sheet. Keep a pointer
to each. When the value is the same, copy from B&C on the temp
to here, and step both. If B is ahead, then step A till they are the
same.
If A is ahead, there's an error someplace.
- Clean up the temp sheet, either deleting it or just clearing it and
leaving
it for the next run.
Attach this to a butto and that should be about it.
Socks