View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Cartoper Cartoper is offline
external usenet poster
 
Posts: 3
Default Sorting data in Excel

I am a C/C++/.Net developer. I am working on a basic Excel
spreadsheet for my son's Boy Scout Troop. A friend gave me the
following code to copy the list of scouts names from one place, sort
it and paste it into another place but for some reason the sorting is
not working. Any suggestions?

Private Sub Workbook_Open()
Sheets("ScoutList08 & Sales-to-date").Select
Range("B2:B75").Select
Selection.Copy
Sheets("DataEntry").Select
Range("C5000").Select
ActiveSheet.Paste
Selection.Sort Key1:=Range("C5001"), Order1:=xlAscending,
Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A6").Select
End Sub

Cartoper