Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sumproduct issues | Excel Worksheet Functions | |||
Cell References | Excel Discussion (Misc queries) | |||
Urgent date/scheduling calc needed | Excel Worksheet Functions | |||
Conversion of Cell Contents into a Functional Worksheet name ? | Excel Worksheet Functions | |||
Function syntax to compare cell contents | Excel Worksheet Functions |