![]() |
Sort control doesn't sort top line
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 |
Sort control doesn't sort top line
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 |
All times are GMT +1. The time now is 02:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com