Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I inherited a macro that sorts in descending order (the first key, actually,
I am happy to eliminate the 2nd key if that helps), but seems to put any blank entries (first key and 2nd key are either both blank or non-blank, I think) at the top, whereas I would prefer they be ignored or, if that is difficult, be put at the bottom. I would think, considering the first sort is a descending number , that a blank would be put at the bottom, but I guess I am wrong since they seem to be at the top. Here is the macro: Selection.Sort Key1:=Range("P18"), Order1:=xlDescending, Key2:=Range( _ "N18"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _ :=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _ DataOption2:=xlSortNormal I cannot seem to figure out how to change this if I do it manually in EXCEL, so perhaps there is no easy way, in which case I need to be more creative, such as assigning zeroes instead of blanks, and then somehow eliminating the zeroes later. Thanks Dean |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
According to the Excel help file for default sort order, blanks should be
last for Ascending or Descending order. Only visible characters and space are reversed, so maybe those are spaces instead of blanks. "Dean" wrote: I inherited a macro that sorts in descending order (the first key, actually, I am happy to eliminate the 2nd key if that helps), but seems to put any blank entries (first key and 2nd key are either both blank or non-blank, I think) at the top, whereas I would prefer they be ignored or, if that is difficult, be put at the bottom. I would think, considering the first sort is a descending number , that a blank would be put at the bottom, but I guess I am wrong since they seem to be at the top. Here is the macro: Selection.Sort Key1:=Range("P18"), Order1:=xlDescending, Key2:=Range( _ "N18"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _ :=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _ DataOption2:=xlSortNormal I cannot seem to figure out how to change this if I do it manually in EXCEL, so perhaps there is no easy way, in which case I need to be more creative, such as assigning zeroes instead of blanks, and then somehow eliminating the zeroes later. Thanks Dean |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Let me check into that. Thanks.
"JLGWhiz" wrote in message ... According to the Excel help file for default sort order, blanks should be last for Ascending or Descending order. Only visible characters and space are reversed, so maybe those are spaces instead of blanks. "Dean" wrote: I inherited a macro that sorts in descending order (the first key, actually, I am happy to eliminate the 2nd key if that helps), but seems to put any blank entries (first key and 2nd key are either both blank or non-blank, I think) at the top, whereas I would prefer they be ignored or, if that is difficult, be put at the bottom. I would think, considering the first sort is a descending number , that a blank would be put at the bottom, but I guess I am wrong since they seem to be at the top. Here is the macro: Selection.Sort Key1:=Range("P18"), Order1:=xlDescending, Key2:=Range( _ "N18"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _ :=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _ DataOption2:=xlSortNormal I cannot seem to figure out how to change this if I do it manually in EXCEL, so perhaps there is no easy way, in which case I need to be more creative, such as assigning zeroes instead of blanks, and then somehow eliminating the zeroes later. Thanks Dean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sorting Issues | Excel Discussion (Misc queries) | |||
Sorting issues | Excel Discussion (Misc queries) | |||
Sorting issues | Excel Worksheet Functions | |||
Sorting issues... | Excel Programming | |||
Issues with sorting | Excel Discussion (Misc queries) |