Tags: andthis, cells, contains, excel, header, headerxguess, headerxlguess, headerxlno, k24p35, microsoft, msdn, parameter, software, sort, statement

Sort - Header:=xlGuess vs Header:=xlNo

On Microsoft » Microsoft Excel

2,299 words with 1 Comments; publish: Sat, 07 Jun 2008 22:05:00 GMT; (30678.13, « »)

Trying to sort cells k24:p35 with no header.

The Header parameter in my Sort statement contains Header:=X|Guess and

this seems to work most times, but sometimes it does not sort properly.

If I use Header:=x|No it sorts properly all the time, but does not work

with an older version of Excel (2001 I think).

What is X|Guess doing that causes the sort to not work sometimes?

My Sort statement is:

Selection.Sort Key1:=Range("p24"), Order1:=xlAscending,

Header:=xlGuess, _

OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _

DataOption1:=xlSortNormal

mwc0914

mwc0914's Profile: http://www.mcse.ms/member.php?action...o&userid=24130

View this thread: http://www.mcse.ms/showthread.php?threadid=472966

All Comments

Leave a comment...

  • 1 Comments
    • header=xlNo

      should work in all version of xl (at least from xl97 on).

      Regards,

      Tom Ogilvy

      "mwc0914" <mwc0914.1wds6m_1128434750.0157.excel.questionfor.info.excelforum-nospam.com> wrote in

      message news:mwc0914.1wds6m_1128434750.0157.excel.questionfor.info.excelforum-nospam.com...

      > Trying to sort cells k24:p35 with no header.

      > The Header parameter in my Sort statement contains Header:=X|Guess and

      > this seems to work most times, but sometimes it does not sort properly.

      > If I use Header:=x|No it sorts properly all the time, but does not work

      > with an older version of Excel (2001 I think).

      > What is X|Guess doing that causes the sort to not work sometimes?

      > My Sort statement is:

      > Selection.Sort Key1:=Range("p24"), Order1:=xlAscending,

      > Header:=xlGuess, _

      > OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _

      > DataOption1:=xlSortNormal

      >

      > --

      > mwc0914

      > mwc0914's Profile:

      http://www.mcse.ms/member.php?action...o&userid=24130

      > View this thread: http://www.mcse.ms/showthread.php?threadid=472966

      >

      #1; Sat, 07 Jun 2008 22:07:00 GMT