Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel sorting in VBScript
I'm having trouble with Excel sorting in a VBScript. I have a number of
cells containing data, starting at row 4. I'm trying to sort each column from row 4 through to the end using the following code: Set objRange = objExcel.Range(Chr(64+column)+"4", Chr(64+column)&row ).Select Set objRange2 = objExcel.Range(Chr(64+column)+"4") objRange.Sort objRange2,,,,,,,1 objRange is my range, objRange2 is the first cell of the column I wish to sort. I also tried: objRange.Sort objRange,,,,,,,1 The sort method does not work in VBScript, nor do a large number of variations of it! I know from a lot of reading that some Excel functionality isn't exposed too well in VBScript... However, the following works for the entire column, using a header row: Set objRange = objExcel.ActiveCell.EntireColumn objRange.Sort objRange,,,,,,,1 Any suggestions would be much appreciated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run VBScript from Excel | Excel Discussion (Misc queries) | |||
Excel & VBScript | Excel Programming | |||
Using excel through vbscript | Excel Programming | |||
VBScript code behind Excel | Excel Programming | |||
VBScript Automation of Excel Spreadsheet Sorting & Filtering | Excel Programming |