• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 429
  • Last Modified:

VBA Sort group

Hello,
Can you please help.
I'm looking for a macro that can sort by count
Please see sample attached.

Note, Number of Rows varies.

Thanks
sample.xlsx
0
W.E.B
Asked:
W.E.B
2 Solutions
 
aikimarkCommented:
Will this work for you?
    Range("A1:O44").Sort Key1:=Range("I1"), Order1:=xlAscending, Header:= _
        xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal

Open in new window

0
 
gowflowCommented:
Easy just don't worry about subtotal select the entire area from A1 to O44
Choose from the Data menu Sort and click on the field Del City if you want them from small to big then choose A to Z else choose Z to A

No need for macro unless if you have already a macro and need to sort all this I would do the following:
 
Usedrange.sort Key1:=range("I1"),order1:=ascending,Header:=xlyes,matchcase:=False

Descending for Z to A

gowflow
0
 
W.E.BAuthor Commented:
Thank you.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now