Excel Sorting 
Author Message
 Excel Sorting

I am trying to sort a spreadsheet that has two columns with the following
code.  When I run basically the same code as a macro and it works fine but
when run in VB.NET it moves column B to Column A and sorts Column A.  Any
ideas?

    .Range("A:A", "B:B").Sort(.Range("A1"), Excel.XlSortOrder.xlAscending)



Sat, 18 Jun 2005 05:17:56 GMT  
 Excel Sorting
Got it to work by doing this. Thanks..

.Range("A:A", "B:B").Sort(.Columns("A"), Excel.XlSortOrder.xlAscending, , ,
, , , , , , Excel.XlSortOrientation.xlSortColumns)


Quote:
> I am trying to sort a spreadsheet that has two columns with the following
> code.  When I run basically the same code as a macro and it works fine but
> when run in VB.NET it moves column B to Column A and sorts Column A.  Any
> ideas?

>     .Range("A:A", "B:B").Sort(.Range("A1"), Excel.XlSortOrder.xlAscending)



Sat, 18 Jun 2005 06:06:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem in running Excel sort function in Access using VBA

2. Excel sort question.

3. VBA Excel sorting problem

4. VBA Excel sorting and cirteria with user input

5. VBA Excel Sorting and Cirteria with user input

6. Excel Sort Ques

7. Excel Sort problem

8. VB and EXCEL Sort

9. How to use "OrderCustom" in Excel sort?

10. Sort order - Edit Filter Sort or Quick Sort

11. VBA/Excel questions; Sorting and Printer Selection

12. Sorting of excel-tables

 

 
Powered by phpBB® Forum Software