LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Could not sort the first row ??


Hie, I am trying to write a macro to sort rows of data according to th
key in a specific column. Below is the code to sort the rows of dat
according to the key in column E:

Sub ColumnE()

TotalRows = ActiveSheet.UsedRange.Rows.Count

Range("A6:AZ" & TotalRows).Select
Selection.Sort Key1:=Range("E6"), Order1:=xlAscending
Key2:=Range("A6") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1
MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
DataOption2 _
:=xlSortNormal

Range("E6").Select

End Sub

However, everytime the first row (in this case is Row 6) just would no
be sorted. The second row (Row 7) onwards work fine.

Can somebody please help!

Many thank

--
Jun-Chi
-----------------------------------------------------------------------
Jun-Chih's Profile: http://www.excelforum.com/member.php...fo&userid=3521
View this thread: http://www.excelforum.com/showthread.php?threadid=54979

 
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
Updating workbook with an alpha sort sheet and a numeric sort shee cjlatta Excel Discussion (Misc queries) 2 January 28th 09 12:00 AM
sort function for dates does not sort properly in Office 2007 Exc. Rosalie Excel Worksheet Functions 1 November 22nd 07 10:25 PM
Pls. reply Sort Data and copy to next coulmn when sort order chang shital shah Excel Programming 1 August 19th 05 02:51 PM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM
sort (on part of) string - originally posted under Tricky Sort Tom Ogilvy Excel Programming 0 August 6th 04 02:42 AM


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