Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Sort by range

I have a current Macro performing a sort for me ...

Range("A1:U700").Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range _
("J2"), Order2:=xlAscending, Key3:=Range("K2"), Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

.... but now I need to insert another sort. Only 3 criteria are allowed. What
I want to do is specify after the sort above that if column A is the letter d
then the section will be sorted ascending by column I.

I hope that makes sense. But Range for this new sort will be constantly
changing it could be rows 229 through 234 or it could be rows 230 through 233
or any other possible combination.

I don't know if this makes any sense but if anyone has any ideas I would
love to hear them.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default Sort by range

What do you mean by "if column A is the letter d"? A column cannot have a
value, only a cell can have a value. Post back and describe what you have.
An example would be good. HTH Otto

"FrankM" wrote in message
...
I have a current Macro performing a sort for me ...

Range("A1:U700").Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range _
("J2"), Order2:=xlAscending, Key3:=Range("K2"),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

... but now I need to insert another sort. Only 3 criteria are allowed.
What
I want to do is specify after the sort above that if column A is the
letter d
then the section will be sorted ascending by column I.

I hope that makes sense. But Range for this new sort will be constantly
changing it could be rows 229 through 234 or it could be rows 230 through
233
or any other possible combination.

I don't know if this makes any sense but if anyone has any ideas I would
love to hear them.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Sort by range

You are absolutely correct, a column can not have a value, I'm sorry for the
miscommunication. What I meant to say is if the cell in column A has the
value, "d", then I want to sort those rows ascending by the values in the
cells of column I.

The number of cells in column A that have the value "d" will be changing
throughout the day. But when I run the Macro I want it to select all the rows
where the cell in the A column has the value "d" and sort it ascending by the
values in column I.

I already have a Macro performing the sorts listed previous this is just an
additional sort after that one is done.

I hope that make sense.



"Otto Moehrbach" wrote:

What do you mean by "if column A is the letter d"? A column cannot have a
value, only a cell can have a value. Post back and describe what you have.
An example would be good. HTH Otto

"FrankM" wrote in message
...
I have a current Macro performing a sort for me ...

Range("A1:U700").Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range _
("J2"), Order2:=xlAscending, Key3:=Range("K2"),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

... but now I need to insert another sort. Only 3 criteria are allowed.
What
I want to do is specify after the sort above that if column A is the
letter d
then the section will be sorted ascending by column I.

I hope that makes sense. But Range for this new sort will be constantly
changing it could be rows 229 through 234 or it could be rows 230 through
233
or any other possible combination.

I don't know if this makes any sense but if anyone has any ideas I would
love to hear them.


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Sort by range

Any ideas? I'd appreciate any suggestions. Thank you.

"FrankM" wrote:

You are absolutely correct, a column can not have a value, I'm sorry for the
miscommunication. What I meant to say is if the cell in column A has the
value, "d", then I want to sort those rows ascending by the values in the
cells of column I.

The number of cells in column A that have the value "d" will be changing
throughout the day. But when I run the Macro I want it to select all the rows
where the cell in the A column has the value "d" and sort it ascending by the
values in column I.

I already have a Macro performing the sorts listed previous this is just an
additional sort after that one is done.

I hope that make sense.



"Otto Moehrbach" wrote:

What do you mean by "if column A is the letter d"? A column cannot have a
value, only a cell can have a value. Post back and describe what you have.
An example would be good. HTH Otto

"FrankM" wrote in message
...
I have a current Macro performing a sort for me ...

Range("A1:U700").Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range _
("J2"), Order2:=xlAscending, Key3:=Range("K2"),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

... but now I need to insert another sort. Only 3 criteria are allowed.
What
I want to do is specify after the sort above that if column A is the
letter d
then the section will be sorted ascending by column I.

I hope that makes sense. But Range for this new sort will be constantly
changing it could be rows 229 through 234 or it could be rows 230 through
233
or any other possible combination.

I don't know if this makes any sense but if anyone has any ideas I would
love to hear them.


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Sort by range

No ideas? Please, someone must have an idea.


"FrankM" wrote:

Any ideas? I'd appreciate any suggestions. Thank you.

"FrankM" wrote:

You are absolutely correct, a column can not have a value, I'm sorry for the
miscommunication. What I meant to say is if the cell in column A has the
value, "d", then I want to sort those rows ascending by the values in the
cells of column I.

The number of cells in column A that have the value "d" will be changing
throughout the day. But when I run the Macro I want it to select all the rows
where the cell in the A column has the value "d" and sort it ascending by the
values in column I.

I already have a Macro performing the sorts listed previous this is just an
additional sort after that one is done.

I hope that make sense.



"Otto Moehrbach" wrote:

What do you mean by "if column A is the letter d"? A column cannot have a
value, only a cell can have a value. Post back and describe what you have.
An example would be good. HTH Otto

"FrankM" wrote in message
...
I have a current Macro performing a sort for me ...

Range("A1:U700").Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range _
("J2"), Order2:=xlAscending, Key3:=Range("K2"),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

... but now I need to insert another sort. Only 3 criteria are allowed.
What
I want to do is specify after the sort above that if column A is the
letter d
then the section will be sorted ascending by column I.

I hope that makes sense. But Range for this new sort will be constantly
changing it could be rows 229 through 234 or it could be rows 230 through
233
or any other possible combination.

I don't know if this makes any sense but if anyone has any ideas I would
love to hear them.

.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Sort by range

I think it's time to describe what you want again.

The code you posted sorted A1:U700. I'm not sure how looking at multiple cells
in column A would determine what range to sort -- or even if it does.

FrankM wrote:

No ideas? Please, someone must have an idea.

"FrankM" wrote:

Any ideas? I'd appreciate any suggestions. Thank you.

"FrankM" wrote:

You are absolutely correct, a column can not have a value, I'm sorry for the
miscommunication. What I meant to say is if the cell in column A has the
value, "d", then I want to sort those rows ascending by the values in the
cells of column I.

The number of cells in column A that have the value "d" will be changing
throughout the day. But when I run the Macro I want it to select all the rows
where the cell in the A column has the value "d" and sort it ascending by the
values in column I.

I already have a Macro performing the sorts listed previous this is just an
additional sort after that one is done.

I hope that make sense.



"Otto Moehrbach" wrote:

What do you mean by "if column A is the letter d"? A column cannot have a
value, only a cell can have a value. Post back and describe what you have.
An example would be good. HTH Otto

"FrankM" wrote in message
...
I have a current Macro performing a sort for me ...

Range("A1:U700").Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range _
("J2"), Order2:=xlAscending, Key3:=Range("K2"),
Order3:=xlAscending, _
Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2:=xlSortNormal, _
DataOption3:=xlSortNormal

... but now I need to insert another sort. Only 3 criteria are allowed.
What
I want to do is specify after the sort above that if column A is the
letter d
then the section will be sorted ascending by column I.

I hope that makes sense. But Range for this new sort will be constantly
changing it could be rows 229 through 234 or it could be rows 230 through
233
or any other possible combination.

I don't know if this makes any sense but if anyone has any ideas I would
love to hear them.

.


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Sort by range

On Apr 2, 2:46*pm, FrankM wrote:
I have a current Macro performing a sort for me ...

* * Range("A1:U700").Sort Key1:=Range("A2"), Order1:=xlDescending,
Key2:=Range _
* * * * ("J2"), Order2:=xlAscending, Key3:=Range("K2"), Order3:=xlAscending, _
* * * * Header:=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:= _
* * * * xlTopToBottom, DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, _
* * * * DataOption3:=xlSortNormal

... but now I need to insert another sort. Only 3 criteria are allowed. What
I want to do is specify after the sort above that if column A is the letter d
then the section will be sorted ascending by column I.

I hope that makes sense. But Range for this new sort will be constantly
changing it could be rows 229 through 234 or it could be rows 230 through 233
or any other possible combination.

I don't know if this makes any sense but if anyone has any ideas I would
love to hear them.


How about instead of sorting column(a), filter it for those rows="d"
and copying the visible rows to another sheet then sorting that subset
by your three criteria??
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
Sort Worksheet Range from another worksheet range, Excel 2000 & 2003 jfcby[_2_] Excel Programming 1 August 21st 07 02:55 AM
Search range and sort another range John[_130_] Excel Programming 0 May 11th 07 12:52 AM
formula to sort a range so that it matches the exact rows of a column that is outside that range? steveo Excel Discussion (Misc queries) 1 June 18th 06 02:05 AM
Sort range changes during sort coffedrinker2003 Excel Discussion (Misc queries) 1 May 24th 05 11:53 PM
sort a range Maileen[_2_] Excel Programming 2 December 31st 04 01:29 PM


All times are GMT +1. The time now is 03:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"