Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All
Below is the code for a sort Macro works OK no problem - the question is that on the sheet there are 20 blocks of 4 line ranges all in the same columns. How would I incorporate them in this little macro. Ranges are as follows C2:D5, C6:D9, C10:D13, C14:D17 as so on down to ranges C54:D57 Sub Macro8() Sheets("Lindop").Select Range("C2:D5").Select ActiveWorkbook.Worksheets("Lindop").Sort.SortField s.Clear ActiveWorkbook.Worksheets("Lindop").Sort.SortField s.Add Key:=Range("D22:D25") _ , SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Lindop").Sort .SetRange Range("C2:D5") .Header = xlGuess .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With End Sub -- Many thanks hazel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Using Macro to sort without clicking on macro button | Excel Discussion (Misc queries) | |||
Sort Macro | Excel Discussion (Misc queries) | |||
Sort Macro | Excel Programming | |||
Sort Macro | Excel Discussion (Misc queries) |