Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problem Sorting Excel Range in VBS

I'm having trouble sorting an Excel spreadsheet in a VBScript file.

I'm connecting to an Access database, and creating my output using the
Excel.Application object.

Here is my code:

objExcelWS.Columns("A:O").Select

objExcelWS.Columns("A:O").Sort key1:=objExcelWS.Columns("D1"),
Order1:=1, key2:=objExcelWS.Range("E1"), Order2:=1,
key3:=objExcelWS.Range("L1"), Order3:=1, Header:=0, OrderCustom:=1,
MatchCase:=False, Orientation:=1

Row 1 has my headers, and I'm getting the error "Expected Statement"
when this line is called.

Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Problem Sorting Excel Range in VBS

Just a guess. Should Header:=0 be change to 1

" wrote:

I'm having trouble sorting an Excel spreadsheet in a VBScript file.

I'm connecting to an Access database, and creating my output using the
Excel.Application object.

Here is my code:

objExcelWS.Columns("A:O").Select

objExcelWS.Columns("A:O").Sort key1:=objExcelWS.Columns("D1"),
Order1:=1, key2:=objExcelWS.Range("E1"), Order2:=1,
key3:=objExcelWS.Range("L1"), Order3:=1, Header:=0, OrderCustom:=1,
MatchCase:=False, Orientation:=1

Row 1 has my headers, and I'm getting the error "Expected Statement"
when this line is called.

Thanks in advance!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Range and Sorting Data Elise148 Excel Discussion (Misc queries) 0 July 5th 07 03:40 PM
sorting problem with range definition Janis Excel Programming 2 September 6th 06 11:01 PM
excel within row sorting problem Ian Excel Discussion (Misc queries) 1 September 14th 05 01:01 AM
excel row sorting problem Terry Thomas Excel Programming 1 March 6th 05 07:17 PM
Problem sorting in Excel Kat Excel Discussion (Misc queries) 2 January 19th 05 03:29 PM


All times are GMT +1. The time now is 05:45 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"