[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Sort Column, Excel 2000 & 2003

James F Cooper

12/15/2006 6:53:00 PM

Hello,

On worksheet2 I have 3 columns that gets added to daily.
ColumnA is Description, ColumnB is Dates, & ColumnC is standard
abbrivations
Christmas 12/25/2006 H
Labor day 9/03/2006 H
Birthday 7/10/2006 B
Annivarsey 9/05/2006 A
Testing 11/02/2006 O

I want to sort on ColumnC keeping all my H together. So how can I sort
columnC so that all my H are kept together in this order H, WH, O, B, A
each letter will multiply dates and descriptions?

Thank you for your help in advance,
jfcby

2 Answers

John Bundy

12/15/2006 9:15:00 PM

0

Cool, never done that before:
Go to Tools->Options and select the custom lists tab. Click add to ad a new
list and enter data in the order of priority H,WH,O,B,A. Now when you go to
Data->Sort select the options button then select your new list from the first
key.. drop down.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"jfcby" wrote:

> Hello,
>
> On worksheet2 I have 3 columns that gets added to daily.
> ColumnA is Description, ColumnB is Dates, & ColumnC is standard
> abbrivations
> Christmas 12/25/2006 H
> Labor day 9/03/2006 H
> Birthday 7/10/2006 B
> Annivarsey 9/05/2006 A
> Testing 11/02/2006 O
>
> I want to sort on ColumnC keeping all my H together. So how can I sort
> columnC so that all my H are kept together in this order H, WH, O, B, A
> each letter will multiply dates and descriptions?
>
> Thank you for your help in advance,
> jfcby
>
>

James F Cooper

12/16/2006 12:01:00 AM

0

Hello,

I've been really struggling with Sort Column macro! During my search
for a sort code I've found one but I do not know how to get it to sort
Sheet2 ColumnC?

Sub SortArray()

Dim myArr1 As Variant
Dim iCtr As Long
Dim jCtr As Long
Dim Temp As Variant

myArr1 = Array("H", "WH", "O", "B", "A")

For iCtr = LBound(myArr1) To UBound(myArr1) - 1
For jCtr = iCtr + 1 To UBound(myArr1)
If myArr1(iCtr) > myArr1(jCtr) Then
Temp = myArr1(iCtr)
myArr1(iCtr) = myArr1(jCtr)
myArr1(jCtr) = Temp
End If
Next jCtr
Next iCtr

For iCtr = LBound(myArr1) To UBound(myArr1)
MsgBox iCtr & "--" & myArr1(iCtr)
Next iCtr

End Sub

Thank you for your help,
jfcby



jfcby wrote:
> Hello,
>
> On worksheet2 I have 3 columns that gets added to daily.
> ColumnA is Description, ColumnB is Dates, & ColumnC is standard
> abbrivations
> Christmas 12/25/2006 H
> Labor day 9/03/2006 H
> Birthday 7/10/2006 B
> Annivarsey 9/05/2006 A
> Testing 11/02/2006 O
>
> I want to sort on ColumnC keeping all my H together. So how can I sort
> columnC so that all my H are kept together in this order H, WH, O, B, A
> each letter will multiply dates and descriptions?
>
> Thank you for your help in advance,
> jfcby