Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks all but after recording a macro again and tweaking it slightly,
came up with the below code which seems to work perfectly. Workbooks(glbMasterFileName).Worksheets("System Data").Activate LastUsedEmplRow = (Worksheets("System Data").Range("F65536").End(-4162).Row) - 0 'Returns last used row Range("F2:H" & LastUsedEmplRow).Select ActiveWorkbook.Worksheets("System Data").Sort.SortFields.Clear ActiveWorkbook.Worksheets("System Data").Sort.SortFields.Add Key:=Range("F2") _ , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("System Data").Sort .SetRange Range("F3:H" & LastUsedEmplRow) .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Thanks, Lakehills |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting a named range using first three columns | Excel Programming | |||
Problem with sorting by date columns | Excel Discussion (Misc queries) | |||
Problem Sorting Excel Range in VBS | Excel Programming | |||
Problem with Range and Sorting Data | Excel Discussion (Misc queries) | |||
Button to sort a range, and sorting 12 columns | Excel Worksheet Functions |