Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Sorting multiple rows...

How can i sort multiple rows from left to right where typically there are
about 50 columns but only maybe 5 or 6 cells in each row have the data that i
want to line up beside each other i have done it before but had to do it
manually a row at a time and there are over 900 rows.?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Sorting multiple rows...

Can you provide a sample before/after of what you're trying to do?
--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Treadstone" wrote:

How can i sort multiple rows from left to right where typically there are
about 50 columns but only maybe 5 or 6 cells in each row have the data that i
want to line up beside each other i have done it before but had to do it
manually a row at a time and there are over 900 rows.?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Sorting multiple rows...

I have several columns to the right of a column with names many empty and
some with dates trying to sort all of these dates in order from left to right
all next to each other so i can have a smaller spreadsheet for easy reference
-- with no gaps (eg column A has the name column B has the first date column
C the second date and so on.
Thus rendering the cells with no data to the right of the final date and
making the spreadsheet to about 6 or 7 columns instead of the usual 50 where
the original information is taken from

"JBeaucaire" wrote:

Can you provide a sample before/after of what you're trying to do?
--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Treadstone" wrote:

How can i sort multiple rows from left to right where typically there are
about 50 columns but only maybe 5 or 6 cells in each row have the data that i
want to line up beside each other i have done it before but had to do it
manually a row at a time and there are over 900 rows.?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Sorting multiple rows...

Try this:

========
Option Explicit

Sub Macro3()
'
' Macro3 Macro
' Macro recorded 11/4/2009 by
'

'
ActiveSheet.Previous.Select
Columns("N:N").Select
Selection.Find(What:="ddd3", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
End Sub
Sub DateSorting()
'JBeaucaire (11/4/2009)
Dim LC As Long, LR As Long, i As Long, MyArr
Application.ScreenUpdating = False
LR = Range("A" & Rows.Count).End(xlUp).Row
LC = Range("A1").SpecialCells(xlCellTypeLastCell).Colum n


For i = 1 To LR
Range("B" & i, Cells(i, LC)).Copy
Cells(1, LC + 2).PasteSpecial xlPasteAll, skipblanks:=True,
Transpose:=True
Range("B" & i, Cells(i, LC)).ClearContents
Columns(LC + 2).Sort Key1:=Cells(1, LC + 2), Order1:=xlAscending,
Header:=xlNo
LR = Cells(Rows.Count, LC + 2).End(xlUp).Row
Range(Cells(1, LC + 2), Cells(LR, LC + 2)).Copy
Range("B" & i).PasteSpecial xlPasteAll, Transpose:=True
Columns(LC + 2).ClearContents
Next i

Application.ScreenUpdating = True
End Sub
==========

Does that work for you?
--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Treadstone" wrote:

I have several columns to the right of a column with names many empty and
some with dates trying to sort all of these dates in order from left to right
all next to each other so i can have a smaller spreadsheet for easy reference
-- with no gaps (eg column A has the name column B has the first date column
C the second date and so on.
Thus rendering the cells with no data to the right of the final date and
making the spreadsheet to about 6 or 7 columns instead of the usual 50 where
the original information is taken from

"JBeaucaire" wrote:

Can you provide a sample before/after of what you're trying to do?
--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Treadstone" wrote:

How can i sort multiple rows from left to right where typically there are
about 50 columns but only maybe 5 or 6 cells in each row have the data that i
want to line up beside each other i have done it before but had to do it
manually a row at a time and there are over 900 rows.?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Sorting multiple rows...

Sorry, copied in too much:

======
Option Explicit

Sub DateSorting()
'JBeaucaire (11/4/2009)
Dim LC As Long, LR As Long, i As Long, MyArr
Application.ScreenUpdating = False
LR = Range("A" & Rows.Count).End(xlUp).Row
LC = Range("A1").SpecialCells(xlCellTypeLastCell).Colum n


For i = 1 To LR
Range("B" & i, Cells(i, LC)).Copy
Cells(1, LC + 2).PasteSpecial xlPasteAll, skipblanks:=True,
Transpose:=True
Range("B" & i, Cells(i, LC)).ClearContents
Columns(LC + 2).Sort Key1:=Cells(1, LC + 2), Order1:=xlAscending,
Header:=xlNo
LR = Cells(Rows.Count, LC + 2).End(xlUp).Row
Range(Cells(1, LC + 2), Cells(LR, LC + 2)).Copy
Range("B" & i).PasteSpecial xlPasteAll, Transpose:=True
Columns(LC + 2).ClearContents
Next i

Application.ScreenUpdating = True
End Sub
==========

--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Treadstone" wrote:

I have several columns to the right of a column with names many empty and
some with dates trying to sort all of these dates in order from left to right
all next to each other so i can have a smaller spreadsheet for easy reference
-- with no gaps (eg column A has the name column B has the first date column
C the second date and so on.
Thus rendering the cells with no data to the right of the final date and
making the spreadsheet to about 6 or 7 columns instead of the usual 50 where
the original information is taken from

"JBeaucaire" wrote:

Can you provide a sample before/after of what you're trying to do?
--
"Actually, I *am* a rocket scientist." -- JB
(www.MadRocketScientist.com)

Your feedback is appreciated, click YES if this post helped you.


"Treadstone" wrote:

How can i sort multiple rows from left to right where typically there are
about 50 columns but only maybe 5 or 6 cells in each row have the data that i
want to line up beside each other i have done it before but had to do it
manually a row at a time and there are over 900 rows.?



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
Sorting number in multiple rows sluvian Excel Discussion (Misc queries) 4 August 3rd 09 09:43 PM
Sorting groups of multiple rows Mel Excel Discussion (Misc queries) 2 June 19th 09 08:40 PM
How many rows after sorting? Big Kahuna Excel Discussion (Misc queries) 5 February 20th 09 05:45 PM
sorting multiple rows CCOD Excel Discussion (Misc queries) 1 July 13th 06 06:53 PM
Sorting with Multiple Rows per Entry Andrew Roberts Excel Worksheet Functions 12 February 25th 06 05:14 AM


All times are GMT +1. The time now is 07:11 PM.

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"