Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2012, 11:35 AM
gbaker gbaker is offline Sorting Challenge Windows 7 32bit Sorting Challenge Office 2010 32bit
Competent Performer
Sorting Challenge
 
Join Date: May 2012
Posts: 111
gbaker is on a distinguished road
Default Sort Challenge

Hi Colin,
Like I said I'm new at this. Can't make it work. Code I used based on the information you gave me but I must be doing something wrong because it come up with a runtime error 424 on this line:

With .Range("Cr2:Cr3980")



Here is the code I'm using for my sheet which I will also attach.

Code:
Sub sortnew()
'
' sortnew  Macro
'
'
    With Data
'get rid of any null strings stored in the cells
     With .Range("Cr2:Cr3980")
            .Value = .Value
    End With
    With .Sort
'set up the sort fields
    With .Sort.SortFields
   .Clear
   .Add Key:=Data.Range("Cr2:Cr3980"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
   .Add Key:=Data.Range("Cs2:Cs3980"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
   .Add Key:=Data.Range("Ct2:Ct3980"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
   .Add Key:=Data.Range("Cu2:Cu3980"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
     End With
        .SetRange Data.Range("Cs2:DE3980")
        .Header = xlNo
        .MatchCase = False
        .Orientation = xlSortColumns
        .SortMethod = xlPinYin
        .Apply
      End With
    End With
 
End Sub
Attached Files
File Type: xlsm test sheet for Colin.xlsm (225.9 KB, 11 views)
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting by certain criteria randenius Excel 2 06-11-2012 02:18 AM
Sorting Challenge Word Challenge jpotter2 Word 3 03-22-2011 02:07 PM
Challenge!! Need help though. (Conditional formatting) knuckles70 Excel 2 02-05-2010 12:24 PM
Sorting Challenge CHALLENGE! Issue sorting data containing relative references on a separate tab lax828 Excel 3 01-07-2010 11:28 AM
Challenge: Get Custom Form to Show up in Reader Pane in 2007 JohnGG Outlook 0 08-21-2009 05:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft