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

I need to create a macro to sort 659 rows by 46 columns. The rows contain
numeric values that need to be sorted for lowest (left) to highest (right).
When I sort manually left to right, the values for every row are not sorted
correctly.

Additionally when I sort manually, the left column in some rows are blank.
This is a spreadsheet that has cells that have been manually updated.

Macro below

Sub SortLefttoRight()
'
' SortLefttoRight Macro
' Macro recorded 12/1/2007 by Carlton A. Barlow
'

'
Range("G15:AZ673").Select
Range("AZ673").Activate
Selection.Sort Key1:=Range("G15"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal
End Sub

All help is greatly appreciated
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,290
Default Sorting rows left to right numerically


When sorting rows, each row moves as a unit. What you have is just
a normal row sort turned on its side. Each column moves as a unit.
You will have to run a loop and sort each row separately.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)
-check out "Special Sort"-


"Carlton A. Barlow"
wrote in message
I need to create a macro to sort 659 rows by 46 columns. The rows contain
numeric values that need to be sorted for lowest (left) to highest (right).
When I sort manually left to right, the values for every row are not sorted
correctly.
Additionally when I sort manually, the left column in some rows are blank.
This is a spreadsheet that has cells that have been manually updated.
Macro below

Sub SortLefttoRight()
' SortLefttoRight Macro
' Macro recorded 12/1/2007 by Carlton A. Barlow
'
Range("G15:AZ673").Select
Range("AZ673").Activate
Selection.Sort Key1:=Range("G15"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal
End Sub

All help is greatly appreciated
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
Right to Left sorting without changing language settings Natemoney2 Excel Discussion (Misc queries) 2 July 18th 07 06:24 PM
sorting contents from right to left Kim Excel Worksheet Functions 1 June 7th 07 01:51 PM
Sorting Right to Left Kaiser Excel Worksheet Functions 1 October 18th 06 02:30 AM
Sorting Numerically [email protected] Excel Worksheet Functions 1 September 28th 06 04:26 AM
Sorting in reverse (from right-to-left and from top-to-bottom) retman Excel Discussion (Misc queries) 6 April 1st 05 09:29 AM


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

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

About Us

"It's about Microsoft Excel"