Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have the worst time trying to code a sort with the sort key......
usually i can make it work (eventually), but i'd like to understand it better. so can somebody explain why this is not working?! xxxxxxxxxxxxxxx Sub userform_initialize() Set Bldgs = ActiveWorkbook.Worksheets(2) Set Temp = ActiveWorkbook.Worksheets(5) MyBldgLastRow = Bldgs.Cells(20000, 1).End(xlUp).Row Set MyBldgs = Temp.Range("a4:a" & MyBldgLastRow) Set MyFindRange = Bldgs.Range("a4:e" & MyBldgLastRow) MyFindRange.Sort Key1:=Range("A4:A4"), Order1:=xlAscending, Header:=xlNone, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom For Each cell In MyBldgs cboBldgList.AddItem cell.Value Next cell End Sub xxxxxxxxxxxxxxxxxxx it worked fine until i added the sort. i've tried making the key range a4:a5 a4 (only) a:a i get the error message "sort method of range class failed" maybe i should take out the "range" & just make it "a4"??? thanks for the assistance (fyi everything's declared in a global mod). susan |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Updating workbook with an alpha sort sheet and a numeric sort shee | Excel Discussion (Misc queries) | |||
sort function for dates does not sort properly in Office 2007 Exc. | Excel Worksheet Functions | |||
Pls. reply Sort Data and copy to next coulmn when sort order chang | Excel Programming | |||
Excel sort by Fill Color by custom list sort | Excel Discussion (Misc queries) | |||
sort (on part of) string - originally posted under Tricky Sort | Excel Programming |