Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Sorting on partial Cell contents VBA

2003

Would like to issue a sort command in VBA that would 1st sort on
Left(AccountNum),4) + Mid(AccountNum,6,2) then 2nd on Date.

In VBA, is it possible manipulate the the following code to achieve
above:

Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, _
Key2:=Range("I2"), Order2:=xlAscending, HEADER:=xlGuess, _
OrderCustom:=1, MatchCase:= False, Orientation:=xlTopToBottom,
DataOption1:=xlSortTextAsNumbers, DataOption2:=xlSortNormal

-OR-

Must I use a helper column in Excel?

TIA EagleOne

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Sorting on partial Cell contents VBA

Excel sorts by the contents of the cell. I think you'll have to use a helper
column to manipulate the data first.

EagleOne wrote:

2003

Would like to issue a sort command in VBA that would 1st sort on
Left(AccountNum),4) + Mid(AccountNum,6,2) then 2nd on Date.

In VBA, is it possible manipulate the the following code to achieve
above:

Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, _
Key2:=Range("I2"), Order2:=xlAscending, HEADER:=xlGuess, _
OrderCustom:=1, MatchCase:= False, Orientation:=xlTopToBottom,
DataOption1:=xlSortTextAsNumbers, DataOption2:=xlSortNormal

-OR-

Must I use a helper column in Excel?

TIA EagleOne


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default Sorting on partial Cell contents VBA

Thanks Dave, that is what I thought - but there are much better XL
minds out there than mine.

EagleOne


Dave Peterson wrote:
Excel sorts by the contents of the cell. I think you'll have to use a helper
column to manipulate the data first.

EagleOne wrote:

2003

Would like to issue a sort command in VBA that would 1st sort on
Left(AccountNum),4) + Mid(AccountNum,6,2) then 2nd on Date.

In VBA, is it possible manipulate the the following code to achieve
above:

Selection.Sort Key1:=Range("A2"), Order1:=xlAscending, _
Key2:=Range("I2"), Order2:=xlAscending, HEADER:=xlGuess, _
OrderCustom:=1, MatchCase:= False, Orientation:=xlTopToBottom,
DataOption1:=xlSortTextAsNumbers, DataOption2:=xlSortNormal

-OR-

Must I use a helper column in Excel?

TIA EagleOne


--

Dave Peterson


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
Sumproduct issues SteveDB1 Excel Worksheet Functions 25 June 3rd 09 04:58 PM
Cell References [email protected] Excel Discussion (Misc queries) 2 November 15th 06 11:37 PM
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
Conversion of Cell Contents into a Functional Worksheet name ? GMJT Excel Worksheet Functions 1 August 21st 05 04:59 PM
Function syntax to compare cell contents ES Excel Worksheet Functions 2 May 18th 05 03:53 PM


All times are GMT +1. The time now is 02:00 PM.

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"