Solved

VBA Sort group

Posted on 2015-02-04
3
417 Views
Last Modified: 2016-02-10
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
Comment
Question by:W.E.B
3 Comments
 
LVL 45

Accepted Solution

by:
aikimark earned 250 total points
ID: 40590223
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
 
LVL 29

Assisted Solution

by:gowflow
gowflow earned 250 total points
ID: 40590644
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
 

Author Closing Comment

by:W.E.B
ID: 40590728
Thank you.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question