Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Sorting rows by pairs

I have a spreadsheet that I need to do some sorting where the information for
each person is on 2 lines. I need to keep the grouped info together. Also,
when I imported this data, it had put to sections together that should have
been seperated. When I do this sort, I would have to eliminate the first 6
spaces. Any help would be greatful. Thanks. Here is an example of what is in
each row:
Row 1:
73.26 0829. DAWSON,ANGELA K D 508347 3 62 4100557000048 070106
073106 167.20 167.20 0.00 0.00 167.20
Row 2:
PROC CO DE - MODIFIER T2002 - U3 070106 073106 167.20 167.20

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Sorting rows by pairs

In order to use the sort function the data have to be on the same row.
--
Brevity is the soul of wit.


"justlearnin" wrote:

I have a spreadsheet that I need to do some sorting where the information for
each person is on 2 lines. I need to keep the grouped info together. Also,
when I imported this data, it had put to sections together that should have
been seperated. When I do this sort, I would have to eliminate the first 6
spaces. Any help would be greatful. Thanks. Here is an example of what is in
each row:
Row 1:
73.26 0829. DAWSON,ANGELA K D 508347 3 62 4100557000048 070106
073106 167.20 167.20 0.00 0.00 167.20
Row 2:
PROC CO DE - MODIFIER T2002 - U3 070106 073106 167.20 167.20

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Sorting rows by pairs

What about using a macro?

"Dave F" wrote:

In order to use the sort function the data have to be on the same row.
--
Brevity is the soul of wit.


"justlearnin" wrote:

I have a spreadsheet that I need to do some sorting where the information for
each person is on 2 lines. I need to keep the grouped info together. Also,
when I imported this data, it had put to sections together that should have
been seperated. When I do this sort, I would have to eliminate the first 6
spaces. Any help would be greatful. Thanks. Here is an example of what is in
each row:
Row 1:
73.26 0829. DAWSON,ANGELA K D 508347 3 62 4100557000048 070106
073106 167.20 167.20 0.00 0.00 167.20
Row 2:
PROC CO DE - MODIFIER T2002 - U3 070106 073106 167.20 167.20

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Sorting rows by pairs

Maybe you can add two additional columns and sort by those.

The first column would contain the common key for that logical pair of rows.
the second column would just be 1, 2, 1, 2, 1, 2... (just an indicator which row
is which row).

Alternatively, you could put all your data on one row, and sort that.

justlearnin wrote:

I have a spreadsheet that I need to do some sorting where the information for
each person is on 2 lines. I need to keep the grouped info together. Also,
when I imported this data, it had put to sections together that should have
been seperated. When I do this sort, I would have to eliminate the first 6
spaces. Any help would be greatful. Thanks. Here is an example of what is in
each row:
Row 1:
73.26 0829. DAWSON,ANGELA K D 508347 3 62 4100557000048 070106
073106 167.20 167.20 0.00 0.00 167.20
Row 2:
PROC CO DE - MODIFIER T2002 - U3 070106 073106 167.20 167.20


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default Sorting rows by pairs

The only problem with all on one row is that there is over 3000 rows of info.
Is there a way to join the two rows when it is imported?

"Dave Peterson" wrote:

Maybe you can add two additional columns and sort by those.

The first column would contain the common key for that logical pair of rows.
the second column would just be 1, 2, 1, 2, 1, 2... (just an indicator which row
is which row).

Alternatively, you could put all your data on one row, and sort that.

justlearnin wrote:

I have a spreadsheet that I need to do some sorting where the information for
each person is on 2 lines. I need to keep the grouped info together. Also,
when I imported this data, it had put to sections together that should have
been seperated. When I do this sort, I would have to eliminate the first 6
spaces. Any help would be greatful. Thanks. Here is an example of what is in
each row:
Row 1:
73.26 0829. DAWSON,ANGELA K D 508347 3 62 4100557000048 070106
073106 167.20 167.20 0.00 0.00 167.20
Row 2:
PROC CO DE - MODIFIER T2002 - U3 070106 073106 167.20 167.20


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Sorting rows by pairs

Maybe you could run a macro that takes the even numbered rows and moves them to
the far right--then deletes the even numbered row.

This is kind of specific and you'll have to modify it.

Option Explicit
Sub testme()

Dim iRow As Long

With ActiveSheet
'starts on an even row
For iRow = .Cells(.Rows.Count, "A").End(xlUp).Row To 1 Step -2
.Cells(iRow, "A").Resize(1, 10).Cut _
Destination:=.Cells(iRow - 1, "Z")
.Rows(iRow).Delete
Next iRow
End With

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

It copies columns A:J using this portion:
..Cells(iRow, "A").Resize(1, 10).Cut
(Starting in A, but make the range 1 row by 10 columns.)
Adjust it to match your data.

And then it pastes in the previous row starting in column Z.
Destination:=.Cells(iRow - 1, "Z")
You'll have to change this, too.

Test it against a copy of your worksheet--it'll destroy it if it's wrong!


justlearnin wrote:

The only problem with all on one row is that there is over 3000 rows of info.
Is there a way to join the two rows when it is imported?

"Dave Peterson" wrote:

Maybe you can add two additional columns and sort by those.

The first column would contain the common key for that logical pair of rows.
the second column would just be 1, 2, 1, 2, 1, 2... (just an indicator which row
is which row).

Alternatively, you could put all your data on one row, and sort that.

justlearnin wrote:

I have a spreadsheet that I need to do some sorting where the information for
each person is on 2 lines. I need to keep the grouped info together. Also,
when I imported this data, it had put to sections together that should have
been seperated. When I do this sort, I would have to eliminate the first 6
spaces. Any help would be greatful. Thanks. Here is an example of what is in
each row:
Row 1:
73.26 0829. DAWSON,ANGELA K D 508347 3 62 4100557000048 070106
073106 167.20 167.20 0.00 0.00 167.20
Row 2:
PROC CO DE - MODIFIER T2002 - U3 070106 073106 167.20 167.20


--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to keep adjacent rows linked when sorting with lists adaire New Users to Excel 2 July 3rd 06 01:59 PM
sorting rows based upon formatting ahaigh Excel Discussion (Misc queries) 5 June 23rd 06 02:29 PM
Counting Match Pairs In Rows bmb2200 Excel Worksheet Functions 4 August 25th 05 03:35 AM
identically size merged cells for sorting rows julieanne12 Excel Discussion (Misc queries) 1 August 24th 05 11:26 AM
sorting out columns but only for some rows Sam Excel Discussion (Misc queries) 5 April 23rd 05 03:20 PM


All times are GMT +1. The time now is 12:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"