Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I'm using the function below to sort my worksheet, the problem I'm having is that everything worked fine until I copied the data to a new "Worksheet" and want the sort to be done on the new sheet not on the "Mainsheet" even when the worksheet has the focus the mainsheet is the one being sorted. What do I need to do? Function My_Column_Sort(First_Data_Row As Integer, AscendingOrder As Boolean, _ First_Column As String, Optional Second_Column As String = "Z", _ Optional Third_Column As String = "Z") 'Allows you to sort the columns in what ever fashion specified. _ using up to Four Columns. Need to build statement in case less then _ four Sort Columns are given. Range("A" & First_Data_Row & ":AA55550").Sort Key1:=Range(First_Column & First_Data_Row), _ Order1:=xlAscending, Key2:=Range(Second_Column & First_Data_Row), _ Order2:=xlAscending, Key3:=Range(Third_Column & First_Data_Row), _ Order3:=xlAscending, Header:=xlNo, _ OrderCustom:=1, MatchCase:=False, _ Orientation:=xlTopToBottom 'AA55550 End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto filter sort ascending not working while sheet protected | Excel Worksheet Functions | |||
adding new data to another sheet from the main sheet | Excel Discussion (Misc queries) | |||
Summarizing data on one main sheet | Excel Worksheet Functions | |||
How do I combine data from several sheets into one main sheet? | Excel Worksheet Functions | |||
Selection from list on main sheet from suplemental sheet in same w | New Users to Excel |