Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default sortingproblem

I want a macro to sort a number of collums
I use the following program

Range(Cells(2, ccol), Cells(i - 1, ccol + 1)).Select

Selection.Sort Key1:=Range(Cells(1, ccol)), Order1:=xlAscending,
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal

ccol is the column number and i is the deph
I get an error in the last line.

What am i doing wrong


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default sortingproblem

Can't tell for sure. I donąt see any continuation characters in your sort.
If it's on more than one line you need the _
To continue the code.

Make sure your range boundaries are getting a valid range. Ccol must be, but
I can't tell about i - 1 from here.

TH

On 4/21/04 15:40, in article , "hans"
wrote:

I want a macro to sort a number of collums
I use the following program

Range(Cells(2, ccol), Cells(i - 1, ccol + 1)).Select

Selection.Sort Key1:=Range(Cells(1, ccol)), Order1:=xlAscending,
Header:=xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal

ccol is the column number and i is the deph
I get an error in the last line.

What am i doing wrong



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



All times are GMT +1. The time now is 08:11 AM.

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

About Us

"It's about Microsoft Excel"