Sort column and take row info with it.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Exel; is there a way to sort Column A and have the information in each row
follow the change?
For example: A5 has 4567 in Column A, with information about 4567 in
different columns but on the same row.
However, when I enter 3456 in Column A, it sorts by number (which I want it
to do), but it leaves the information about 4567 in that row. I need the
information to correspond with the number in Column A.
Does anyone know how to correct this problem?
 
With
A1:D100
And the information in cells B1:D100 pertain to their respective values in
Col_A

Before sorting A1:A100....Select A1:D100

If you will sort using one of the [sort] buttons..make sure a cell in Col_A
is the active cell, then click the [sort] button

Or
You can use the Excel menu
<data><sort>
Select the column to sort on
Click the [OK] button

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
Ron, Thank you for answering, However, I had already tried that. It didn't
work. The information in the rows is not going to the matching number in
column A. The information is staying put and only the number 4567 and 3456
are moving to different locations (Accending).

Ron Coderre said:
With
A1:D100
And the information in cells B1:D100 pertain to their respective values in
Col_A

Before sorting A1:A100....Select A1:D100

If you will sort using one of the [sort] buttons..make sure a cell in Col_A
is the active cell, then click the [sort] button

Or
You can use the Excel menu
<data><sort>
Select the column to sort on
Click the [OK] button

Does that help?
***********
Regards,
Ron

XL2002, WinXP


Michaela said:
In Exel; is there a way to sort Column A and have the information in each row
follow the change?
For example: A5 has 4567 in Column A, with information about 4567 in
different columns but on the same row.
However, when I enter 3456 in Column A, it sorts by number (which I want it
to do), but it leaves the information about 4567 in that row. I need the
information to correspond with the number in Column A.
Does anyone know how to correct this problem?
 
In your post you wrote:

"when I enter 3456 in Column A, it sorts by number (which I want it to
do)"

How is this sort being triggered? If you wrote code to do this sort, you
will need to reference the whole area that is being sorted, not just the
column you want to sort by.

eg.
Range("A31:D34").Sort Key1:=Range("A31"), Order1:=xlAscending

Which will keep the additional information in columns B, C and D on the same
row as the value in column A they correspond with.

Michaela said:
Ron, Thank you for answering, However, I had already tried that. It didn't
work. The information in the rows is not going to the matching number in
column A. The information is staying put and only the number 4567 and 3456
are moving to different locations (Accending).

Ron Coderre said:
With
A1:D100
And the information in cells B1:D100 pertain to their respective values in
Col_A

Before sorting A1:A100....Select A1:D100

If you will sort using one of the [sort] buttons..make sure a cell in Col_A
is the active cell, then click the [sort] button

Or
You can use the Excel menu
<data><sort>
Select the column to sort on
Click the [OK] button

Does that help?
***********
Regards,
Ron

XL2002, WinXP


Michaela said:
In Exel; is there a way to sort Column A and have the information in each row
follow the change?
For example: A5 has 4567 in Column A, with information about 4567 in
different columns but on the same row.
However, when I enter 3456 in Column A, it sorts by number (which I want it
to do), but it leaves the information about 4567 in that row. I need the
information to correspond with the number in Column A.
Does anyone know how to correct this problem?
 
Hi Michaela

I don't think you can have done what Ron suggested.
You need to select your "whole" block of data first, then carry out the
sort.
Excel sometimes doesn't make a very good guess at what you want sorted,
and it is always safer to define the range yourself.

Provided you have selected the relevant data first, it will do what you
want and keep data in other columns in line with the new sorted values
in column A.

--
Regards

Roger Govier


Michaela said:
Ron, Thank you for answering, However, I had already tried that. It
didn't
work. The information in the rows is not going to the matching number
in
column A. The information is staying put and only the number 4567 and
3456
are moving to different locations (Accending).

Ron Coderre said:
With
A1:D100
And the information in cells B1:D100 pertain to their respective
values in
Col_A

Before sorting A1:A100....Select A1:D100

If you will sort using one of the [sort] buttons..make sure a cell in
Col_A
is the active cell, then click the [sort] button

Or
You can use the Excel menu
<data><sort>
Select the column to sort on
Click the [OK] button

Does that help?
***********
Regards,
Ron

XL2002, WinXP


Michaela said:
In Exel; is there a way to sort Column A and have the information
in each row
follow the change?
For example: A5 has 4567 in Column A, with information about 4567
in
different columns but on the same row.
However, when I enter 3456 in Column A, it sorts by number (which
I want it
to do), but it leaves the information about 4567 in that row. I
need the
information to correspond with the number in Column A.
Does anyone know how to correct this problem?
 

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

Back
Top