View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default How to sort in the worksheet?

You have a syntax error
xlSheet.Range(xx).Sort xlSheet.Range(xxx)

If you include the arugment in parentheses and you are not returning a
value, you cause the argument to be evaluated, so in this case, the argument
becomes the value in the range rather than a reference to the range (which
is what is required).

--
Regards,
Tom Ogilvy


"YaYa" wrote in message
...
Hello,

I write a asp.net web page with Excel.Application for creating a Excel

File.
I want that worksheet be sorted by some column.
I use xlSheet.Range(xx).Sort(xlSheet.Range(xxx)).
But it doesn't sort by my assigning.

How to sort the worksheet?

Thanks