Smart Device
Windows Forms
Visual FoxPro
Visual J#
Visual C++
Microsoft ISV
Visual Basic
Architecture
Windows Live
Game Technologies
.NET Development
Visual C#
VS Express Editions
VS Team System
Windows Vista
Software Development Network>> Microsoft ISV>> Sorting 3 columns in Excel using VBA.
Sorting 3 columns in Excel using VBA.
Hot Topic
Excel, Forms, and Charts
Simple question on FrontPage / Internet Explorer
Setting Autonumber back to zero
Open an excel file
.Net and DoD/NSA acceptance
run a macro in excel
Run-time error 13, "Type Mismatch" in Excel application
Access VBA and detecting when the form changes records
need help for VBA code(MS Access)
MODI Port
Microsoft ISV
Trouble signing up for the Microsoft Empower for ISVs
Form Requery
Autosave using VBA after n minutes
cannot save file as
Moving to Office 2003
What version of Team System do EmpowerISV members get?
Bounded frame object... how to activate in native app.
Important MS Partner Question
Excel VBA
What is ISV
Sorting 3 columns in Excel using VBA.
Hi
im trying to sort a 3 columns in excel using VBA. I was able to sort the first but when its time to sort the second the first sort is disregarded.
Please help.
PSD
Answer this question
Sorting 3 columns in Excel using VBA.
John Cherian
Use the code similar to the one below
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Key2:=Range("B1") _
, Order2:=xlAscending, Key3:=Range("C1"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
This was done on a selection
However, you can use Range to sort
Sorting 3 columns in Excel using VBA.
Answer this question
Sorting 3 columns in Excel using VBA.
John Cherian
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Key2:=Range("B1") _
, Order2:=xlAscending, Key3:=Range("C1"), Order3:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
This was done on a selection
However, you can use Range to sort