Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
working out % of correctness gives #DIV/0! | Excel Discussion (Misc queries) | |||
Convert Excel document to PDF with different page orientation | Excel Discussion (Misc queries) | |||
Advice on correctness of using subs | Excel Programming | |||
How can I display a value from a spreadsheet cell in a column in a document library? | Excel Programming | |||
Sort Orientation | Excel Programming |