Sorting on partial Cell contents VBA

  • Thread starter Thread starter EagleOne
  • Start date Start date
E

EagleOne

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
 
Excel sorts by the contents of the cell. I think you'll have to use a helper
column to manipulate the data first.
 
Thanks Dave, that is what I thought - but there are much better XL
minds out there than mine.

EagleOne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top