ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort Order with Dates & Text (https://www.excelbanter.com/excel-programming/388693-sort-order-dates-text.html)

Minitman[_5_]

Sort Order with Dates & Text
 
Greetings,

I am trying to sort a column with dates & text in it. The problem is
the second cell. All of the cells have a date in them except for the
second cell, which has text in it. This row needs to stay in the same
position.

I am using three columns in my sort. If I could get a forth sort
criteria, I could use another column to exclude the rows that I don't
want to move.

Is there any way to do this?

If not, is there any other way to keep the second cell in column A
from moving?

Any help will be appreciated.

-Minitman

joel

Sort Order with Dates & Text
 
It seem like you have a header rows that don't need to be part of the sort.
Exclude these rows 1-3). All columns of your sort shuld have the same number
of header rows. If some of the date starts in row 2 and other start in row
3, then you have to modify worksheet by adding rows so all columns have the
same number of headers.


"Minitman" wrote:

Greetings,

I am trying to sort a column with dates & text in it. The problem is
the second cell. All of the cells have a date in them except for the
second cell, which has text in it. This row needs to stay in the same
position.

I am using three columns in my sort. If I could get a forth sort
criteria, I could use another column to exclude the rows that I don't
want to move.

Is there any way to do this?

If not, is there any other way to keep the second cell in column A
from moving?

Any help will be appreciated.

-Minitman


Minitman[_5_]

Sort Order with Dates & Text
 
Hey Joel,

Thanks for the reply.

My apologizes for not explaining my sheet very well.

Rows 1, 2 & 3 are all header columns. Row 4 is a row filled with all
of the formulas copied down to the first new entry (the code copies
the last row to the next row and then deletes the values in the first
7 cells. Then puts the new data into those newly emptied cells).
Cell A4 has to have something in it for the code to work.

I was having trouble getting the sort to NOT sort from row 1. How can
I get the sort to start at row 5?

Here is my current code:

________________________________________________
Cells.Select
Selection.Sort Key1:=Range("A5"), _
Order1:=xlAscending, _
Key2:=Range("B5"), _
Order2:=xlAscending, _
Key3:=Range("E5"), _
Order3:=xlAscending, _
Header:=xlYes, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal
Range("A65536").End(xlUp).Offset(0, 4).Select
________________________________________________
The range argument row of 5 doesn't seem to work.

Any idea's?

-Minitman



On Fri, 4 May 2007 03:43:02 -0700, Joel
wrote:

It seem like you have a header rows that don't need to be part of the sort.
Exclude these rows 1-3). All columns of your sort shuld have the same number
of header rows. If some of the date starts in row 2 and other start in row
3, then you have to modify worksheet by adding rows so all columns have the
same number of headers.


"Minitman" wrote:

Greetings,

I am trying to sort a column with dates & text in it. The problem is
the second cell. All of the cells have a date in them except for the
second cell, which has text in it. This row needs to stay in the same
position.

I am using three columns in my sort. If I could get a forth sort
criteria, I could use another column to exclude the rows that I don't
want to move.

Is there any way to do this?

If not, is there any other way to keep the second cell in column A
from moving?

Any help will be appreciated.

-Minitman




All times are GMT +1. The time now is 05:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com