LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
JCO JCO is offline
external usenet poster
 
Posts: 54
Default Modify Sort Routine to inlcude All Data

I have a sort routine shown below: However, I need H62, F62, B62 & I62 to
not be fixed. How can I determine this number which can be 3000 lines of
data. How do I enter this in the code.
Thanks

Private Sub SortCategoryAssistanceWithHeaders()
'///////////////////////////////////////////////////
'
' SortCategoryAssistanceWithHeaders Macro
' jco - This routine will do a triple level sort
' on 3-columns, omitting the Header
'
'///////////////////////////////////////////////////
'
Cells.Select
ActiveWorkbook.ActiveSheet.Sort.SortFields.Clear
ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key _
:=Range("H2:H62"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption _
:=xlSortNormal
ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key _
:=Range("F2:F62"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption _
:=xlSortNormal
ActiveWorkbook.ActiveSheet.Sort.SortFields.Add Key _
:=Range("B2:B62"), SortOn:=xlSortOnValues, Order:=xlAscending,
DataOption _
:=xlSortNormal
With ActiveWorkbook.ActiveSheet.Sort
.SetRange Range("A1:I62")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub

 
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
Custom Sort Routine [email protected] Excel Programming 1 October 10th 08 08:46 PM
Sort Routine Platinum girl[_2_] Excel Discussion (Misc queries) 0 March 9th 07 03:21 PM
Generalising sort routine lexcel Excel Programming 0 June 3rd 06 02:57 PM
Sort Routine VBA weeper Excel Programming 2 September 29th 04 02:59 PM
Need a Special Sort Routine weeper Excel Programming 0 September 28th 04 07:49 PM


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