Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel - special sort

Hi,

i have different rows, where there are just special values allowed.

for example: one | two | three

if i sort the row, i can just say to sort it ascending one-three-two
or descending two-three-one but i'd like to get one-two-three

How can i realize this problem (in each row, there a a mximum of 10
different names to sort)?

Thanks,
Thomas
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Excel - special sort

Thomas,

Create a custom list with three elements (Tools menu, Options,
Custom Lists) and then in the Sort dialog, choose Options and
select this list.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Thomas" wrote in message
om...
Hi,

i have different rows, where there are just special values

allowed.

for example: one | two | three

if i sort the row, i can just say to sort it ascending

one-three-two
or descending two-three-one but i'd like to get one-two-three

How can i realize this problem (in each row, there a a mximum

of 10
different names to sort)?

Thanks,
Thomas



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel - special sort

Hi Thomas!
is it possible for you to translate the one - two and three into a new
column with numbers and sort it from that column?

Torstein

"Thomas" skrev i melding
om...
Hi,

i have different rows, where there are just special values allowed.

for example: one | two | three

if i sort the row, i can just say to sort it ascending one-three-two
or descending two-three-one but i'd like to get one-two-three

How can i realize this problem (in each row, there a a mximum of 10
different names to sort)?

Thanks,
Thomas



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Excel - special sort

add a table with all your text values in the first column
and its corresponding decimal in a second column
on your sheet, add a column to the right of your list
then add a VLOOKUP formula, then sort the list based off
the this new column.

In the sub below I assume a column starts at G1 but is of
indeterminate length. I have elsewhere on another sheet a
range called MyTable which is a column of words and a
column of numbers. The words on my worksheet in G1 are in
this list.
The code inserts a new column, ads the formula, sorts the
list then deletes the inserted column...leaving your list
of words sorted as per the values in MyTable

Sub SortList()

Dim Target As Range

Set Target = Range(Range("G1"), Range("G1").End
(xlDown))

Dim cl As Long
cl = Target.Column + 1
Columns(cl).Insert
With Target.Offset(0, 1)

.FormulaR1C1 = "=VLookup(RC[-1],MyTable,2,False)"

End With

With Target.Resize(Target.Rows.Count, 2)

.Sort Target.Offset(0, 1), xlAscending

End With

Columns(cl).Delete


End Sub


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hi,

i have different rows, where there are just special

values allowed.

for example: one | two | three

if i sort the row, i can just say to sort it ascending

one-three-two
or descending two-three-one but i'd like to get one-two-

three

How can i realize this problem (in each row, there a a

mximum of 10
different names to sort)?

Thanks,
Thomas
.

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
Special Sort Help James E Middleton Excel Discussion (Misc queries) 2 March 6th 07 09:42 AM
Special sort for oldest and newest date DTTODGG Excel Discussion (Misc queries) 1 October 11th 06 05:17 PM
3 level sort, last special order David Excel Worksheet Functions 4 September 27th 06 12:26 AM
Excel sort by Fill Color by custom list sort Dash4Cash Excel Discussion (Misc queries) 2 July 29th 05 10:45 PM
Zip code sort is an Excel problem even when using the special cat. camead Excel Discussion (Misc queries) 2 March 31st 05 01:15 AM


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

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"