Sort and Group - Using VBA

Bobbybazza

New Member
Joined
Mar 7, 2013
Messages
5
Hi, is possible for a little help please. I'm looking to sort a simple data table by Column D and then display that data in groups with the Options from D as headings for the data that corresponds to them. Would this equate to a pivot table of some kind or is there an easier way? The output will not need to be manipulated after just displayed against this criteria. Hopefully this makes sense.

Test.xlsm
ABCD
1ReferenceName FirstName LastTeam
21018717AlexandraSMITHAFC Bournemouth
31018782AlisonJONESArsenal
41018781AmandaWILLIAMSAston Villa
51019774AmeliaTAYLORBrentford
61019776AmyBROWNBrighton and Hove Albion
71019775AndreaDAVIESChelsea
81018658AngelaEVANSBrentford
91018659AnnaWILSONBrighton and Hove Albion
101018730AnneTHOMASChelsea
111018730AudreyJOHNSONAston Villa
121018703AvaROBERTSBrentford
131018704BellaROBINSONBrighton and Hove Albion
141018704BernadetteTHOMPSONBrighton and Hove Albion
151018704CarolWRIGHTChelsea
161018704CarolineWALKERBrentford
171018724CarolynWHITEBrighton and Hove Albion
181018741ChloeEDWARDSChelsea
191018705ClaireHUGHESBrentford
201018710DeirdreGREENBrentford
211018708DianaHALLBrighton and Hove Albion
221019342DianeLEWISChelsea
231018941DonnaHARRISArsenal
241019383DorothyCLARKEAston Villa
251018709ElizabethPATELBrentford
261018925EllaJACKSONBrighton and Hove Albion
271018775EmilyWOODChelsea
281018773EmmaTURNERArsenal
291018771FaithMARTINAston Villa
301018766FelicityCOOPERAston Villa
311018768FionaHILLBrentford
321019007GabrielleWARDArsenal
331018715GraceMORRISAston Villa
341018711HannahMOOREBrighton and Hove Albion
351019778HeatherCLARKChelsea
361018738IreneLEEAston Villa
371019112JanKINGBrentford
381019345JaneBAKERArsenal
391018767JasmineHARRISONAston Villa
401019022JenniferMORGANAston Villa
411019875JessicaALLENBrentford
421018740JoanJAMESBrighton and Hove Albion
431018606JoanneSCOTTChelsea
441018605JuliaPHILLIPSArsenal
451019015KarenWATSONAston Villa
461019014KatherineDAVISBrighton and Hove Albion
471018723KimberlyPARKERChelsea
481018608KyliePRICEArsenal
491018720LaurenBENNETTAston Villa
501018860LeahYOUNGBrentford
511019021LillianGRIFFITHSBrighton and Hove Albion
521018737LilyMITCHELLBrentford
531018728LisaKELLYBrighton and Hove Albion
Data
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A26Cell ValueduplicatestextNO
A26Cell ValueduplicatestextNO
A26Cell ValueduplicatestextNO
A26Cell ValueduplicatestextNO
A53Cell ValueduplicatestextNO
A53Cell ValueduplicatestextNO
A53Cell ValueduplicatestextNO
A53Cell ValueduplicatestextNO
A52Cell ValueduplicatestextNO
A52Cell ValueduplicatestextNO
A52Cell ValueduplicatestextNO
A52Cell ValueduplicatestextNO
A23Cell ValueduplicatestextNO
A23Cell ValueduplicatestextNO
A23Cell ValueduplicatestextNO
A23Cell ValueduplicatestextNO
A25Cell ValueduplicatestextNO
A25Cell ValueduplicatestextNO
A25Cell ValueduplicatestextNO
A48:A51Cell ValueduplicatestextNO
A48:A51Cell ValueduplicatestextNO
A48:A51Cell ValueduplicatestextNO


Output:

Test.xlsm
ABCDE
1ReferenceName FirstName Last
2AFC Bournemouth
31018717AlexandraSMITH
4Arsenal
51018782AlisonJONES
61018941DonnaHARRIS
71018773EmmaTURNER
81019007GabrielleWARD
91019345JaneBAKER
101018605JuliaPHILLIPS
111018608KyliePRICE
12Aston Villa
131018781AmandaWILLIAMS
141018730AudreyJOHNSON
151019383DorothyCLARKE
161018771FaithMARTIN
171018766FelicityCOOPER
181018715GraceMORRIS
191018738IreneLEE
201018767JasmineHARRISON
211019022JenniferMORGAN
221019015KarenWATSON
231018720LaurenBENNETT
24Brentford
251019774AmeliaTAYLOR
261018658AngelaEVANS
271018703AvaROBERTS
281018704CarolineWALKER
291018705ClaireHUGHES
301018710DeirdreGREEN
311018709ElizabethPATEL
321018768FionaHILL
331019112JanKING
341019875JessicaALLEN
351018860LeahYOUNG
361018737LilyMITCHELL
37Brighton and Hove Albion
381019776AmyBROWN
391018659AnnaWILSON
401018704BellaROBINSON
411018704BernadetteTHOMPSON
421018724CarolynWHITE
431018708DianaHALL
441018925EllaJACKSON
451018711HannahMOORE
461018740JoanJAMES
471019014KatherineDAVIS
481019021LillianGRIFFITHS
491018728LisaKELLY
50Chelsea
511019775AndreaDAVIES
521018730AnneTHOMAS
531018704CarolWRIGHT
541018741ChloeEDWARDS
551019342DianeLEWIS
561018775EmilyWOOD
571019778HeatherCLARK
581018606JoanneSCOTT
591018723KimberlyPARKER
60
Output
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A30Cell ValueduplicatestextNO
A30Cell ValueduplicatestextNO
A30Cell ValueduplicatestextNO
A30Cell ValueduplicatestextNO
A59Cell ValueduplicatestextNO
A59Cell ValueduplicatestextNO
A59Cell ValueduplicatestextNO
A59Cell ValueduplicatestextNO
A58Cell ValueduplicatestextNO
A58Cell ValueduplicatestextNO
A58Cell ValueduplicatestextNO
A58Cell ValueduplicatestextNO
A27Cell ValueduplicatestextNO
A27Cell ValueduplicatestextNO
A27Cell ValueduplicatestextNO
A27Cell ValueduplicatestextNO
A29Cell ValueduplicatestextNO
A29Cell ValueduplicatestextNO
A29Cell ValueduplicatestextNO
A54:A57Cell ValueduplicatestextNO
A54:A57Cell ValueduplicatestextNO
A54:A57Cell ValueduplicatestextNO
 
Last edited by a moderator:

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top