Aligning numbers in seperate columns

D

Dr Jones

Hi all,

I have a bit of a problem I can't figure out although I think I migh
be missing something very obvious.

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 tak
C along for the ride
 
P

Pete_UK

Do you mean that you want column A right-aligned and column B
left-aligned, so that in your example data it would look like you have
12, 25, 36 etc? If so, then highlight column B and click the left-align
icon - if this is not visible you can click Format | Cells etc.

I'm not sure what you want to do with column C.

Hope this helps.

Pete
 
D

Dr Jones

No as in I want to align 1 up with 1 and 5 with 5 etc, one column ha
consecutive numbers and I want to align the other column with th
consecutive numbers. At the moment I've gone through and inserted row
until it lines up but this is very time consuming.

I have a column of numbers in a random format that I want to alig
against the numbers in another column. Not all numbers are present al
the time
 
P

Puppet_Sock

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
 

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