Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a spreadsheet with several columns, and a control button above each
one to sort the sheet by that column. For one of the columns, it sometimes (not always) leaves the first row out of the sort (first row remains on top, rest of the rows get sorted. The sort buttons occupy rows 1 and 2, the column headings are on row 3, and the data begins in row 4. Here is the code behind the button: Private Sub Sort_status_Click() Range("A4:D200").Sort Key1:=Range("D4"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _ :=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _ DataOption2:=xlSortNormal End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try :
Header:=xlNo HTH,-- AP "Humphrey Bogart" <Humphrey a écrit dans le message de news: ... I have a spreadsheet with several columns, and a control button above each one to sort the sheet by that column. For one of the columns, it sometimes (not always) leaves the first row out of the sort (first row remains on top, rest of the rows get sorted. The sort buttons occupy rows 1 and 2, the column headings are on row 3, and the data begins in row 4. Here is the code behind the button: Private Sub Sort_status_Click() Range("A4:D200").Sort Key1:=Range("D4"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _ :=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _ DataOption2:=xlSortNormal End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks - that seems to have done the trick.
Try : Header:=xlNo I have a spreadsheet with several columns, and a control button above each one to sort the sheet by that column. For one of the columns, it sometimes (not always) leaves the first row out of the sort (first row remains on top, rest of the rows get sorted. The sort buttons occupy rows 1 and 2, the column headings are on row 3, and the data begins in row 4. Here is the code behind the button: Private Sub Sort_status_Click() Range("A4:D200").Sort Key1:=Range("D4"), Order1:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _ :=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _ DataOption2:=xlSortNormal End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I control the sort order of a filter in a pivot table? | Excel Discussion (Misc queries) | |||
Control Excel page breaks during sort? | Excel Discussion (Misc queries) | |||
Sort beginning one-line BELOW what should be | Excel Programming | |||
I need to control how users sort in a specific excell worksheet | Excel Programming | |||
I need to control how users sort in a specific excell worksheet | Excel Programming |