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

I'd like a general sort macro that will sort the selected
rows in our Schedule spreadsheet, always by the same two
columns, with no header rows.

After creating a recorded one, the code specifies the top
cell in each column in the Key# criteria. This will in
general, be different each time.

TIA
Kevin Sprinkel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Sort macro by same columns

Just use the top cell of the column as the Key1 and Key2 criteria:

Key1:= Range("A1"), Key2:= Range("B1")

Or am I misunderstanding you?

--

Vasant




"Kevin Sprinkel" wrote in message
...
I'd like a general sort macro that will sort the selected
rows in our Schedule spreadsheet, always by the same two
columns, with no header rows.

After creating a recorded one, the code specifies the top
cell in each column in the Key# criteria. This will in
general, be different each time.

TIA
Kevin Sprinkel



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Sort macro by same columns

This would sort all rows; I want only to sort the selected
range. So what would be useful is a function that
returned the top row of the selected range, so that I
could build the Key1, Key2 criteria:

Dim strK1 as String
strK1 = "A" & strval(<RowReturnedfromFunction)
Key1:=Range(strK1)

Can you point me in the right direction?

Thank you.
Kevin Sprinkel

-----Original Message-----
Just use the top cell of the column as the Key1 and Key2

criteria:

Key1:= Range("A1"), Key2:= Range("B1")

Or am I misunderstanding you?

--

Vasant




"Kevin Sprinkel"

wrote in message
...
I'd like a general sort macro that will sort the

selected
rows in our Schedule spreadsheet, always by the same two
columns, with no header rows.

After creating a recorded one, the code specifies the

top
cell in each column in the Key# criteria. This will in
general, be different each time.

TIA
Kevin Sprinkel



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Sort macro by same columns

Did you try it?

--

Vasant

"Kevin Sprinkel" wrote in message
...
This would sort all rows; I want only to sort the selected
range. So what would be useful is a function that
returned the top row of the selected range, so that I
could build the Key1, Key2 criteria:

Dim strK1 as String
strK1 = "A" & strval(<RowReturnedfromFunction)
Key1:=Range(strK1)

Can you point me in the right direction?

Thank you.
Kevin Sprinkel

-----Original Message-----
Just use the top cell of the column as the Key1 and Key2

criteria:

Key1:= Range("A1"), Key2:= Range("B1")

Or am I misunderstanding you?

--

Vasant




"Kevin Sprinkel"

wrote in message
...
I'd like a general sort macro that will sort the

selected
rows in our Schedule spreadsheet, always by the same two
columns, with no header rows.

After creating a recorded one, the code specifies the

top
cell in each column in the Key# criteria. This will in
general, be different each time.

TIA
Kevin Sprinkel



.



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 by color: Is there an easy way to sort columns or rows in EX MGP Excel Worksheet Functions 5 August 16th 08 11:28 AM
sort by two columns ends up with wrong sort in 2nd col urbnjckct Excel Discussion (Misc queries) 3 November 2nd 07 01:25 AM
Sort command does not sort some columns? BillyBob New Users to Excel 4 May 11th 06 04:16 PM
How do I sort the data in 8 columns by two of the columns? Sorting Excel Worksheet Functions 1 October 25th 05 03:57 PM
data sort is not including all columns in sort Tracy Excel Discussion (Misc queries) 1 October 4th 05 12:16 AM


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

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

About Us

"It's about Microsoft Excel"