View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Francisco Francisco is offline
external usenet poster
 
Posts: 25
Default Sort bug on Excel 2007

Thanks, but it does not work.
I have sheet(1) as active sheet and it does work on Excel 2003, the problem
is Excel 2007.

"Helmut Meukel" wrote:

The range in Key1 is not full qualified,
try this:
Sheets(1).Range(SortRange1).Sort _
Key1:=Sheets(1).Range(CellToSort), _
Order1:=xlAscending, Header:=xlYes

Helmut.

"Francisco" schrieb im Newsbeitrag
...
On Excel 2003 it works perfectly, on Excel 2007 I have error 1004 "sort
method of range class failed".


Sub SortSalary(CellToSort As String, SortRange1 As String)
Sheets(1).Range(SortRange1).Sort Key1:=Range(CellToSort),
Order1:=xlAscending, Header:=xlYes
End if


Is it a bug on Excel 2007?



.