Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default sorting code problems


I try this code to sort my sheet but end up losing my header (which i
row 1) Can anyone help me figure out why?


Code
-------------------
Rows("1:61775").Select
Range("C1").Activate
Selection.sort Key1:=Range("C1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

-------------------

--
DK
-----------------------------------------------------------------------
DKY's Profile: http://www.excelforum.com/member.php...fo&userid=1451
View this thread: http://www.excelforum.com/showthread.php?threadid=26315

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default sorting code problems

Change xlGuess to xlYes

Rows("1:61775").Select
Range("C1").Activate
Selection.sort Key1:=Range("C1"), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

--
Regards,
Tom Ogilvy

"DKY" wrote in message
...

I try this code to sort my sheet but end up losing my header (which is
row 1) Can anyone help me figure out why?


Code:
--------------------
Rows("1:61775").Select
Range("C1").Activate
Selection.sort Key1:=Range("C1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

--------------------


--
DKY
------------------------------------------------------------------------
DKY's Profile:

http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=263154



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default sorting code problems

Hi,
Read the sort parameters, Header =: xlGuess. ( and check the sort
parameters in Help)
Excell did a wrong guess. Change it to xlYes
Regards,

JY


"DKY" wrote in message
...

I try this code to sort my sheet but end up losing my header (which is
row 1) Can anyone help me figure out why?


Code:
--------------------
Rows("1:61775").Select
Range("C1").Activate
Selection.sort Key1:=Range("C1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

--------------------


--
DKY
------------------------------------------------------------------------
DKY's Profile:

http://www.excelforum.com/member.php...o&userid=14515
View this thread: http://www.excelforum.com/showthread...hreadid=263154



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
sorting problems tab Excel Discussion (Misc queries) 2 February 18th 10 04:07 PM
Problems due to sorting [email protected] Excel Discussion (Misc queries) 2 June 14th 06 11:38 PM
sorting problems sbrimley Excel Worksheet Functions 1 April 4th 05 10:09 PM
Need Help with Sorting Problems Brenda Rueter Excel Discussion (Misc queries) 1 March 21st 05 04:25 PM
Problems merging an excel file due to code or file problems? Cindy M -WordMVP- Excel Programming 0 September 14th 04 02:58 PM


All times are GMT +1. The time now is 10:39 PM.

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

About Us

"It's about Microsoft Excel"