Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I control the sort order of a filter in a pivot table? Grizz Excel Discussion (Misc queries) 1 December 20th 08 02:01 PM
Control Excel page breaks during sort? Lori H Excel Discussion (Misc queries) 1 August 4th 06 03:29 AM
Sort beginning one-line BELOW what should be Jim May Excel Programming 10 January 21st 06 03:13 PM
I need to control how users sort in a specific excell worksheet Kim Melkane Excel Programming 2 June 1st 05 08:00 AM
I need to control how users sort in a specific excell worksheet Kim Melkane Excel Programming 0 May 31st 05 01:21 PM


All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"