Home

Sort Macro

%3CLINGO-SUB%20id%3D%22lingo-sub-536323%22%20slang%3D%22en-US%22%3ESort%20Macro%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-536323%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20trying%20to%20sort%20multiple%20rows%20and%20columns%20in%20descending%20order%20using%20a%20macro.%20I%20want%20to%20sort%20by%20column%20D%2C%20but%20I'm%20a%20stuck%20with%20the%20formula%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20my%20Macro%3A%3C%2FP%3E%3CP%3ESub%20Sort_by_Shop()%3CBR%20%2F%3EColumns(%22D%22).Sort%20Key1%3A%3DRange(%22D%22)%2C%20Order1%3A%3DxlDescending%2C%20Header%3A%3DxlYes%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F112364i7C5B17132C8606ED%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Screenshot.png%22%20title%3D%22Screenshot.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-536323%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Dave Galy
New Contributor

I'm trying to sort multiple rows and columns in descending order using a macro. I want to sort by column D, but I'm a stuck with the formula below.

 

Here is my Macro:

Sub Sort_by_Shop()
Columns("D").Sort Key1:=Range("D"), Order1:=xlDescending, Header:=xlYes
End Sub

 

Screenshot.png

Related Conversations
flashing a white screen while open new tab
cntvertex in Discussions on
13 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
22 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
PacketMon Components are not loading in WAC 1909
HotCakeX in Windows Admin Center on
2 Replies