View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
fugfug[_9_] fugfug[_9_] is offline
external usenet poster
 
Posts: 1
Default Code for Advanced Sort


If your interested the code I used is as follows, customers is the shee
with the data to be sorted on.

Sub List()
'
' List Macro
' Macro recorded 12/07/2005 by James Fuggle
Sheets.Add
ActiveSheet.Select
ActiveSheet.Name = "List"
Range("A1").Select

Dim reply As String
Do Until reply = "stop"
ActiveCell.Offset(1, 0).Select


reply = InputBox("Enter company name", "Company Input")
ActiveCell.FormulaR1C1 = reply


Loop
ActiveCell.ClearContents

Application.AddCustomList ListArray:=Range("A1:A2000")

Sheets("Customers").Select
Range("A3:N2000").Select
Selection.Sort Key1:=Range("A3"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=(Application.CustomListCount) + 1, MatchCase:=False
Orientation:=xlTopToBottom

End Su

--
fugfu
-----------------------------------------------------------------------
fugfug's Profile: http://www.excelforum.com/member.php...fo&userid=2495
View this thread: http://www.excelforum.com/showthread.php?threadid=38670