|
-
Sorting a subtotaled spreadsheet programmatically
I have created a spreadsheet using VB, populated it with a few thousand rows and subtotaled it using the Range().Subtotal method.
So far so good!
I now need to sort the rows by the subtotal value in the subtotal column. I know it's possible because I can do this 'manually' on the spreadsheet simply by clicking on the column head and hey-presto the groups are sorted, not the individual rows.
I have tried the following code:
Range(groupStartCell).Sort(Key1:=worksheet.Range("F2" & lastRow.ToString), Order1:=Interop.Excel.XlSortOrder.xlDescending, Orientation:=Interop.Excel.XlSortOrientation.xlSortRows, Header:=Interop.Excel.XlYesNoGuess.xlGuess, OrderCustom:=1, MatchCase:=False)
and it does nothing!
Similar Threads
-
By anonymous in forum VB Classic
Replies: 1
Last Post: 04-23-2004, 11:49 PM
-
By Willy Van den Driessche in forum VB Classic
Replies: 11
Last Post: 04-11-2002, 04:31 PM
-
Replies: 2
Last Post: 09-28-2001, 11:04 AM
-
By Dale Boyer in forum VB Classic
Replies: 6
Last Post: 01-29-2001, 12:57 PM
-
By Dale Boyer in forum VB Classic
Replies: 0
Last Post: 01-26-2001, 02:22 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks