Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Sorting row data?!

Hi everyone,

I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.

Is there a smart way to do this one time?

Thanks,
Jo

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Sorting row data?!

If i get what you are asking select the area you want to sort, go to Data-
Sort select Options and change the Orientation box to Left and Right then
select your row to sort by.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Jo" wrote:

Hi everyone,

I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.

Is there a smart way to do this one time?

Thanks,
Jo


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Sorting row data?!

On Aug 15, 10:14 am, John Bundy (remove) wrote:
If i get what you are asking select the area you want to sort, go to Data-
Sort select Options and change the Orientation box to Left and Right then
select your row to sort by.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.



"Jo" wrote:
Hi everyone,


I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.


Is there a smart way to do this one time?


Thanks,
Jo- Hide quoted text -


- Show quoted text -


John,

That what I did with one row, but how it can be done for 5000 rows;
each row by itself.....it is none sens to do it 5000 times

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Sorting row data?!

I asssume you want to sort each row, from left to right and that you're
looking for a macro to do that. Here's one way:

Sub test()
Dim r As Range

For Each r In ActiveSheet.UsedRange.Rows
r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight
Next r
End Sub



--
Hope that helps.

Vergel Adriano


"Jo" wrote:

Hi everyone,

I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.

Is there a smart way to do this one time?

Thanks,
Jo


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Sorting row data?!

On Aug 15, 10:22 am, Vergel Adriano
wrote:
I asssume you want to sort each row, from left to right and that you're
looking for a macro to do that. Here's one way:

Sub test()
Dim r As Range

For Each r In ActiveSheet.UsedRange.Rows
r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight
Next r
End Sub

--
Hope that helps.

Vergel Adriano



"Jo" wrote:
Hi everyone,


I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.


Is there a smart way to do this one time?


Thanks,
Jo- Hide quoted text -


- Show quoted text -


Vergel,

Are you sure it is correct? I am getting these two rows in RED:

r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Sorting row data?!

Jo,

The newsreader wrapped the text to the next line. Make sure you put this in
just one line:

r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending, Orientation:=xlLeftToRight



--
Hope that helps.

Vergel Adriano


"Jo" wrote:

On Aug 15, 10:22 am, Vergel Adriano
wrote:
I asssume you want to sort each row, from left to right and that you're
looking for a macro to do that. Here's one way:

Sub test()
Dim r As Range

For Each r In ActiveSheet.UsedRange.Rows
r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight
Next r
End Sub

--
Hope that helps.

Vergel Adriano



"Jo" wrote:
Hi everyone,


I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.


Is there a smart way to do this one time?


Thanks,
Jo- Hide quoted text -


- Show quoted text -


Vergel,

Are you sure it is correct? I am getting these two rows in RED:

r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default Sorting row data?!

On Aug 15, 11:18 am, Vergel Adriano
wrote:
Jo,

The newsreader wrapped the text to the next line. Make sure you put this in
just one line:

r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending, Orientation:=xlLeftToRight

--
Hope that helps.

Vergel Adriano



"Jo" wrote:
On Aug 15, 10:22 am, Vergel Adriano
wrote:
I asssume you want to sort each row, from left to right and that you're
looking for a macro to do that. Here's one way:


Sub test()
Dim r As Range


For Each r In ActiveSheet.UsedRange.Rows
r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight
Next r
End Sub


--
Hope that helps.


Vergel Adriano


"Jo" wrote:
Hi everyone,


I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.


Is there a smart way to do this one time?


Thanks,
Jo- Hide quoted text -


- Show quoted text -


Vergel,


Are you sure it is correct? I am getting these two rows in RED:


r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight- Hide quoted text -


- Show quoted text -


What if I don't want the whole row but a range of rows I highlight
1st?

Reason is the 1st cell in in each row is somehow an ID code (number
too) which I don't sorting to touch!......

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Sorting row data?!

Jo,

To skip the first cell of each row, do it this way:

Sub test()
Dim r As Range

For Each r In ActiveSheet.UsedRange.Rows
r.Offset(0, 1).Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Header:=xlYes, Orientation:=xlLeftToRight
Next r
End Sub


To sort the rows in a range that you will select first, then this way:

Sub test2()
Dim r As Range

For Each r In Selection.Rows
r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight
Next r
End Sub



--
Hope that helps.

Vergel Adriano


"Jo" wrote:

On Aug 15, 11:18 am, Vergel Adriano
wrote:
Jo,

The newsreader wrapped the text to the next line. Make sure you put this in
just one line:

r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending, Orientation:=xlLeftToRight

--
Hope that helps.

Vergel Adriano



"Jo" wrote:
On Aug 15, 10:22 am, Vergel Adriano
wrote:
I asssume you want to sort each row, from left to right and that you're
looking for a macro to do that. Here's one way:


Sub test()
Dim r As Range


For Each r In ActiveSheet.UsedRange.Rows
r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight
Next r
End Sub


--
Hope that helps.


Vergel Adriano


"Jo" wrote:
Hi everyone,


I know how to sort data by row, but say I have 5000 or more rows!
Going to each row and doing the sorting is time-consuming.


Is there a smart way to do this one time?


Thanks,
Jo- Hide quoted text -


- Show quoted text -


Vergel,


Are you sure it is correct? I am getting these two rows in RED:


r.Sort key1:=r.Cells(1, 1), Order1:=xlAscending,
Orientation:=xlLeftToRight- Hide quoted text -


- Show quoted text -


What if I don't want the whole row but a range of rows I highlight
1st?

Reason is the 1st cell in in each row is somehow an ID code (number
too) which I don't sorting to touch!......


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 Data Molly Excel Discussion (Misc queries) 3 November 15th 08 12:31 AM
Sorting data to match existing data Jack C Excel Discussion (Misc queries) 4 May 24th 06 09:48 AM
Sorting of Data Charlie Excel Programming 3 May 2nd 06 10:25 AM
Need help sorting data jbf frylock Excel Discussion (Misc queries) 5 March 24th 06 11:12 PM
colors of bar charted data don't follow data after sorting Frankgjr Charts and Charting in Excel 2 January 17th 06 12:33 PM


All times are GMT +1. The time now is 08:50 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"