Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Sort.Orientation Query correctness of me or Library document

I am a very inexperienced Office Developer (assuming I even qualify as one).
I query whether a document under MSDN Library might be incorrect; however, I
believe it is more likely that the error will lie with my understanding.
Under the 'Excel 2007 Developer Reference' the document for the property
"Sort.Orientation" (http://msdn.microsoft.com/en-us/library/bb148040.aspx)
appears to contradict the code example in the document "Sort Object"
(http://msdn.microsoft.com/en-us/library/bb178505.aspx). The value constants
in the "Sort.Orientation" document ("xlSortColumns" and "xlSortRows") raise a
runtime error '1004'; the vlaue in the "Sort Object" document
("xlTopToBottom") does not riase this error.
Can somebody please shed some light on this for me as it is clouding my
understanding of the Sort Object.

--
Anthony
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Sort.Orientation Query correctness of me or Library document

Anthony,

If you open the Object Browser (F2 from VBE) and search "xlSortOrientation,"
you'll notice that the "Members of 'XLSortOrientation'" are xlSortColumns and
xlSortRows. If you click on xlSortColumns, you'll notice it has a value of 1
(as noted in the window just below the "Classes" section), and you'll also
notice that xlSortRows has a value of 2. Additionally, if you search
"xlTopToBottom," you'll notice that it is part of the "Constants" class and
has a value of 1. So, it won't matter whether you use xlSortColumns or
xlTopToBottom because both have a value of 1.

All the following are equivalent:
.....Sort.Orientation = xlSortColumns
.....Sort.Orientation = xlTopToBottom
.....Sort.Orientation = 1

I hope this helps.

Best,

Matthew Herbert

"awrl100" wrote:

I am a very inexperienced Office Developer (assuming I even qualify as one).
I query whether a document under MSDN Library might be incorrect; however, I
believe it is more likely that the error will lie with my understanding.
Under the 'Excel 2007 Developer Reference' the document for the property
"Sort.Orientation" (http://msdn.microsoft.com/en-us/library/bb148040.aspx)
appears to contradict the code example in the document "Sort Object"
(http://msdn.microsoft.com/en-us/library/bb178505.aspx). The value constants
in the "Sort.Orientation" document ("xlSortColumns" and "xlSortRows") raise a
runtime error '1004'; the vlaue in the "Sort Object" document
("xlTopToBottom") does not riase this error.
Can somebody please shed some light on this for me as it is clouding my
understanding of the Sort Object.

--
Anthony

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Sort.Orientation Query correctness of me or Library document

Thank you Matthew. What a surprise... the fault turned out to lie with me. I
incorrectly interpreted xlSortRows as 'sort BY rows' instead of 'sort THROUGH
rows'. Your post drawing attention to the evaluation of these constants
provided the breakthrough. When I used "xlSortColumns" equating to
"xlSortTopToBottom" ,no error, output was as designed.

Best Regards
--
Anthony


"Matthew Herbert" wrote:

Anthony,

If you open the Object Browser (F2 from VBE) and search "xlSortOrientation,"
you'll notice that the "Members of 'XLSortOrientation'" are xlSortColumns and
xlSortRows. If you click on xlSortColumns, you'll notice it has a value of 1
(as noted in the window just below the "Classes" section), and you'll also
notice that xlSortRows has a value of 2. Additionally, if you search
"xlTopToBottom," you'll notice that it is part of the "Constants" class and
has a value of 1. So, it won't matter whether you use xlSortColumns or
xlTopToBottom because both have a value of 1.

All the following are equivalent:
....Sort.Orientation = xlSortColumns
....Sort.Orientation = xlTopToBottom
....Sort.Orientation = 1

I hope this helps.

Best,

Matthew Herbert

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
working out % of correctness gives #DIV/0! Carrach Excel Discussion (Misc queries) 2 April 27th 10 01:41 PM
Convert Excel document to PDF with different page orientation Menchie Excel Discussion (Misc queries) 1 November 20th 08 04:50 PM
Advice on correctness of using subs Planner[_3_] Excel Programming 1 May 4th 08 07:28 PM
How can I display a value from a spreadsheet cell in a column in a document library? Roger Eriksen[_2_] Excel Programming 0 May 13th 05 04:55 PM
Sort Orientation Otto Moehrbach[_6_] Excel Programming 3 April 26th 04 04:19 AM


All times are GMT +1. The time now is 09:38 AM.

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"