Indexing or Ignore Blank rows
Blank rows are being sorted to the bottom of the sort range. Because there
is no data you are not seeing this effect. Put numbers into columns that are
not part in the sort keys. You will then see what is really happening.
" wrote:
I am having trouble retaining blank rows in a worksheet upon sorting,
I have the sort code as follows:
Sub SortJS()
WS.Activate
Selection.Sort Key1:=Range("G2"), Order1:=xlAscending,
Key2:=Range("E2") _
, Order2:=xlAscending, Header:=xlYes, OrderCustom:=1,
MatchCase:=False _
, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:= _
xlSortNormal
End Sub
As normal any blank rows are wiped out, I can't find a good way to
prevent this from happening so I need to know if there is an "Column
Index" function in Excel similar to MS Access where an Index column is
automatically numbered and corrected for any new or deleted entries.
If this is possible I can use this column to sort all of the data and
keep it hidden.
Thanks,
Chad
|