Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I'm using Excel 2003 and am having trouble sorting data. Here is the code that I am using: Application.Worksheets("Sheet1").Select Application.Worksheets("Sheet1").Range("A1:A8").Se lect Selection.Sort Key1:=Range("A1"), _ Order1:=xlAscending, _ Header:=xlGuess, _ OrderCustom:=1, _ MatchCase:=False, _ Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Here is my error message: The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank. The code comes alomst entirely from a the Macro I recorded, which works. Meaning, if I select this range manually, the data sorts without a hiccup. But if I try and execute code genned by the same sort Macro, VBA throws an error. The only lines that did not come from the Macro are the first line, selecting the worksheet and the "Application.Worksheets("Sheet1")." I appended in front of Range. Here is the data I have in Sheet1, Column A, Rows 1-8: 89100400 93092800 93701200 170074488 319529926 390162282 494995008 597663764 Totally confused. Any help would be greatly appreciated. Thanks, Scott |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Sorting Problem | Excel Discussion (Misc queries) | |||
problem sorting data | Excel Discussion (Misc queries) | |||
Problem with Sorting Data | Excel Discussion (Misc queries) | |||
data sorting problem | Excel Worksheet Functions | |||
data sorting problem | Excel Worksheet Functions |