Multiple Sort In Same Column

RandyD123

Active Member
Joined
Dec 4, 2013
Messages
296
Office Version
  1. 2016
Platform
  1. Windows
I am looking to sort using a VBA code that will sort my attached sheet by Airline then by Time. The only catch is that the Airlines must be held together, meaning all DL first by time, then all SW second by time......and so on. Each individual day must sort using the code. Obviously this is only part of the sheet that I attached but I assume if this is even possible I can just continue the code to get all 42 individual calendar blocks.

If possible with on space between each one.

Thank you to anyone that can help.

[TABLE="width: 1650"]
<tbody>[TR]
[TD="colspan: 4"]Tuesday, March 1, 2016[/TD]
[TD][/TD]
[TD="colspan: 4"]Wednesday, March 2, 2016[/TD]
[TD][/TD]
[TD="colspan: 4"]Thursday, March 3, 2016[/TD]
[TD][/TD]
[TD="colspan: 4"]Friday, March 4, 2016[/TD]
[TD][/TD]
[TD="colspan: 4"]Saturday, March 5, 2016[/TD]
[TD][/TD]
[TD="colspan: 4"]Sunday, March 6, 2016[/TD]
[/TR]
[TR]
[TD]Airline[/TD]
[TD]Dest[/TD]
[TD]Time[/TD]
[TD]Cap.[/TD]
[TD][/TD]
[TD]Airline[/TD]
[TD]Dest[/TD]
[TD]Time[/TD]
[TD]Cap.[/TD]
[TD][/TD]
[TD]Airline[/TD]
[TD]Dest[/TD]
[TD]Time[/TD]
[TD]Cap.[/TD]
[TD][/TD]
[TD]Airline[/TD]
[TD]Dest[/TD]
[TD]Time[/TD]
[TD]Cap.[/TD]
[TD][/TD]
[TD]Airline[/TD]
[TD]Dest[/TD]
[TD]Time[/TD]
[TD]Cap.[/TD]
[TD][/TD]
[TD]Airline[/TD]
[TD]Dest[/TD]
[TD]Time[/TD]
[TD]Cap.[/TD]
[/TR]
[TR]
[TD]US4577[/TD]
[TD]DCA[/TD]
[TD]1800[/TD]
[TD]75[/TD]
[TD][/TD]
[TD]US4577[/TD]
[TD]DCA[/TD]
[TD]1800[/TD]
[TD]75[/TD]
[TD][/TD]
[TD]US4577[/TD]
[TD]DCA[/TD]
[TD]1800[/TD]
[TD]75[/TD]
[TD][/TD]
[TD]US4577[/TD]
[TD]DCA[/TD]
[TD]1800[/TD]
[TD]75[/TD]
[TD][/TD]
[TD]US4577[/TD]
[TD]DCA[/TD]
[TD]1800[/TD]
[TD]75[/TD]
[TD][/TD]
[TD]US4577[/TD]
[TD]DCA[/TD]
[TD]1800[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]US4472[/TD]
[TD]PHL[/TD]
[TD]1500[/TD]
[TD]50[/TD]
[TD]US4472[/TD]
[TD]PHL[/TD]
[TD]1500[/TD]
[TD]50[/TD]
[TD]US4472[/TD]
[TD]PHL[/TD]
[TD]1500[/TD]
[TD]50[/TD]
[TD]US4472[/TD]
[TD]PHL[/TD]
[TD]1500[/TD]
[TD]50[/TD]
[TD]US4472[/TD]
[TD]PHL[/TD]
[TD]1500[/TD]
[TD]50[/TD]
[TD]US4472[/TD]
[TD]PHL[/TD]
[TD]1500[/TD]
[TD]50[/TD]
[/TR]
[TR]
[TD]US4465[/TD]
[TD]CLT[/TD]
[TD]1200[/TD]
[TD]80[/TD]
[TD]US4465[/TD]
[TD]CLT[/TD]
[TD]1200[/TD]
[TD]80[/TD]
[TD]US4465[/TD]
[TD]CLT[/TD]
[TD]1200[/TD]
[TD]80[/TD]
[TD]US4465[/TD]
[TD]CLT[/TD]
[TD]1200[/TD]
[TD]80[/TD]
[TD]US4465[/TD]
[TD]CLT[/TD]
[TD]1200[/TD]
[TD]80[/TD]
[TD]US4465[/TD]
[TD]CLT[/TD]
[TD]1200[/TD]
[TD]80[/TD]
[/TR]
[TR]
[TD]US3827[/TD]
[TD]PHL[/TD]
[TD]1400[/TD]
[TD]75[/TD]
[TD]US3827[/TD]
[TD]PHL[/TD]
[TD]1400[/TD]
[TD]75[/TD]
[TD]US3827[/TD]
[TD]PHL[/TD]
[TD]1400[/TD]
[TD]75[/TD]
[TD]US3827[/TD]
[TD]PHL[/TD]
[TD]1400[/TD]
[TD]75[/TD]
[TD]US3827[/TD]
[TD]PHL[/TD]
[TD]1400[/TD]
[TD]75[/TD]
[TD]US3827[/TD]
[TD]PHL[/TD]
[TD]1400[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]US4082[/TD]
[TD]PHL[/TD]
[TD]800[/TD]
[TD]100[/TD]
[TD]US4082[/TD]
[TD]PHL[/TD]
[TD]800[/TD]
[TD]100[/TD]
[TD]US4082[/TD]
[TD]PHL[/TD]
[TD]800[/TD]
[TD]100[/TD]
[TD]US4082[/TD]
[TD]PHL[/TD]
[TD]800[/TD]
[TD]100[/TD]
[TD]US4082[/TD]
[TD]PHL[/TD]
[TD]800[/TD]
[TD]100[/TD]
[TD]US4082[/TD]
[TD]PHL[/TD]
[TD]800[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]US3775[/TD]
[TD]DCA[/TD]
[TD]700[/TD]
[TD]45[/TD]
[TD]US3775[/TD]
[TD]DCA[/TD]
[TD]700[/TD]
[TD]45[/TD]
[TD]US3775[/TD]
[TD]DCA[/TD]
[TD]700[/TD]
[TD]45[/TD]
[TD]US3775[/TD]
[TD]DCA[/TD]
[TD]700[/TD]
[TD]45[/TD]
[TD]US3775[/TD]
[TD]DCA[/TD]
[TD]700[/TD]
[TD]45[/TD]
[TD]US3775[/TD]
[TD]DCA[/TD]
[TD]700[/TD]
[TD]45[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SW1270[/TD]
[TD]MDW[/TD]
[TD]530[/TD]
[TD]175[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SW647[/TD]
[TD]BWI[/TD]
[TD]555[/TD]
[TD]143[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]SW1537[/TD]
[TD]MCO[/TD]
[TD]605[/TD]
[TD]143[/TD]
[TD]SW1270[/TD]
[TD]MDW[/TD]
[TD]530[/TD]
[TD]175[/TD]
[TD]SW1270[/TD]
[TD]MDW[/TD]
[TD]530[/TD]
[TD]175[/TD]
[TD]SW1270[/TD]
[TD]MDW[/TD]
[TD]530[/TD]
[TD]175[/TD]
[TD]SW1270[/TD]
[TD]MDW[/TD]
[TD]530[/TD]
[TD]175[/TD]
[TD]SW1270[/TD]
[TD]MDW[/TD]
[TD]530[/TD]
[TD]175[/TD]
[/TR]
[TR]
[TD]SW452[/TD]
[TD]BWI[/TD]
[TD]700[/TD]
[TD]137[/TD]
[TD]SW647[/TD]
[TD]BWI[/TD]
[TD]555[/TD]
[TD]143[/TD]
[TD]SW647[/TD]
[TD]BWI[/TD]
[TD]555[/TD]
[TD]143[/TD]
[TD]SW647[/TD]
[TD]BWI[/TD]
[TD]555[/TD]
[TD]143[/TD]
[TD]SW647[/TD]
[TD]BWI[/TD]
[TD]555[/TD]
[TD]143[/TD]
[TD]SW647[/TD]
[TD]BWI[/TD]
[TD]555[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD]SW1092[/TD]
[TD]BWI[/TD]
[TD]400[/TD]
[TD]175[/TD]
[TD]SW1537[/TD]
[TD]MCO[/TD]
[TD]605[/TD]
[TD]143[/TD]
[TD]SW1537[/TD]
[TD]MCO[/TD]
[TD]605[/TD]
[TD]143[/TD]
[TD]SW1537[/TD]
[TD]MCO[/TD]
[TD]605[/TD]
[TD]143[/TD]
[TD]SW1537[/TD]
[TD]MCO[/TD]
[TD]605[/TD]
[TD]143[/TD]
[TD]SW1537[/TD]
[TD]MCO[/TD]
[TD]605[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD]SW767[/TD]
[TD]BWI[/TD]
[TD]500[/TD]
[TD]143[/TD]
[TD]SW452[/TD]
[TD]BWI[/TD]
[TD]700[/TD]
[TD]137[/TD]
[TD]SW452[/TD]
[TD]BWI[/TD]
[TD]700[/TD]
[TD]137[/TD]
[TD]SW452[/TD]
[TD]BWI[/TD]
[TD]700[/TD]
[TD]137[/TD]
[TD]SW452[/TD]
[TD]BWI[/TD]
[TD]700[/TD]
[TD]137[/TD]
[TD]SW452[/TD]
[TD]BWI[/TD]
[TD]700[/TD]
[TD]137[/TD]
[/TR]
[TR]
[TD]SW3850[/TD]
[TD]TPA[/TD]
[TD]800[/TD]
[TD]143[/TD]
[TD]SW1092[/TD]
[TD]BWI[/TD]
[TD]400[/TD]
[TD]175[/TD]
[TD]SW1092[/TD]
[TD]BWI[/TD]
[TD]400[/TD]
[TD]175[/TD]
[TD]SW1092[/TD]
[TD]BWI[/TD]
[TD]400[/TD]
[TD]175[/TD]
[TD]SW1092[/TD]
[TD]BWI[/TD]
[TD]400[/TD]
[TD]175[/TD]
[TD]SW1092[/TD]
[TD]BWI[/TD]
[TD]400[/TD]
[TD]175[/TD]
[/TR]
[TR]
[TD]SW802[/TD]
[TD]MDW[/TD]
[TD]1750[/TD]
[TD]175[/TD]
[TD]SW767[/TD]
[TD]BWI[/TD]
[TD]500[/TD]
[TD]143[/TD]
[TD]SW767[/TD]
[TD]BWI[/TD]
[TD]500[/TD]
[TD]143[/TD]
[TD]SW767[/TD]
[TD]BWI[/TD]
[TD]500[/TD]
[TD]143[/TD]
[TD]SW767[/TD]
[TD]BWI[/TD]
[TD]500[/TD]
[TD]143[/TD]
[TD]SW767[/TD]
[TD]BWI[/TD]
[TD]500[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD]SW2513[/TD]
[TD]BWI[/TD]
[TD]1215[/TD]
[TD]143[/TD]
[TD]SW3850[/TD]
[TD]TPA[/TD]
[TD]800[/TD]
[TD]143[/TD]
[TD]SW3850[/TD]
[TD]TPA[/TD]
[TD]800[/TD]
[TD]143[/TD]
[TD]SW3850[/TD]
[TD]TPA[/TD]
[TD]800[/TD]
[TD]143[/TD]
[TD]SW3850[/TD]
[TD]TPA[/TD]
[TD]800[/TD]
[TD]143[/TD]
[TD]SW3850[/TD]
[TD]TPA[/TD]
[TD]800[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD]SW1533[/TD]
[TD]BWI[/TD]
[TD]1450[/TD]
[TD]143[/TD]
[TD]SW802[/TD]
[TD]MDW[/TD]
[TD]1750[/TD]
[TD]175[/TD]
[TD]SW802[/TD]
[TD]MDW[/TD]
[TD]1750[/TD]
[TD]175[/TD]
[TD]SW802[/TD]
[TD]MDW[/TD]
[TD]1750[/TD]
[TD]175[/TD]
[TD]SW802[/TD]
[TD]MDW[/TD]
[TD]1750[/TD]
[TD]175[/TD]
[TD]SW802[/TD]
[TD]MDW[/TD]
[TD]1750[/TD]
[TD]175[/TD]
[/TR]
[TR]
[TD]SW302[/TD]
[TD]BWI[/TD]
[TD]1705[/TD]
[TD]143[/TD]
[TD]SW2513[/TD]
[TD]BWI[/TD]
[TD]1215[/TD]
[TD]143[/TD]
[TD]SW2513[/TD]
[TD]BWI[/TD]
[TD]1215[/TD]
[TD]143[/TD]
[TD]SW2513[/TD]
[TD]BWI[/TD]
[TD]1215[/TD]
[TD]143[/TD]
[TD]SW2513[/TD]
[TD]BWI[/TD]
[TD]1215[/TD]
[TD]143[/TD]
[TD]SW2513[/TD]
[TD]BWI[/TD]
[TD]1215[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD]SW750[/TD]
[TD]MDW[/TD]
[TD]1400[/TD]
[TD]175[/TD]
[TD]SW1533[/TD]
[TD]BWI[/TD]
[TD]1450[/TD]
[TD]143[/TD]
[TD]SW1533[/TD]
[TD]BWI[/TD]
[TD]1450[/TD]
[TD]143[/TD]
[TD]SW1533[/TD]
[TD]BWI[/TD]
[TD]1450[/TD]
[TD]143[/TD]
[TD]SW1533[/TD]
[TD]BWI[/TD]
[TD]1450[/TD]
[TD]143[/TD]
[TD]SW1533[/TD]
[TD]BWI[/TD]
[TD]1450[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD]SW2222[/TD]
[TD]MDW[/TD]
[TD]1830[/TD]
[TD]175[/TD]
[TD]SW302[/TD]
[TD]BWI[/TD]
[TD]1705[/TD]
[TD]143[/TD]
[TD]SW302[/TD]
[TD]BWI[/TD]
[TD]1705[/TD]
[TD]143[/TD]
[TD]SW302[/TD]
[TD]BWI[/TD]
[TD]1705[/TD]
[TD]143[/TD]
[TD]SW302[/TD]
[TD]BWI[/TD]
[TD]1705[/TD]
[TD]143[/TD]
[TD]SW302[/TD]
[TD]BWI[/TD]
[TD]1705[/TD]
[TD]143[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]SW750[/TD]
[TD]MDW[/TD]
[TD]1400[/TD]
[TD]175[/TD]
[TD]SW750[/TD]
[TD]MDW[/TD]
[TD]1400[/TD]
[TD]175[/TD]
[TD]SW750[/TD]
[TD]MDW[/TD]
[TD]1400[/TD]
[TD]175[/TD]
[TD]SW750[/TD]
[TD]MDW[/TD]
[TD]1400[/TD]
[TD]175[/TD]
[TD]SW750[/TD]
[TD]MDW[/TD]
[TD]1400[/TD]
[TD]175[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]SW2222[/TD]
[TD]MDW[/TD]
[TD]1830[/TD]
[TD]175[/TD]
[TD]SW2222[/TD]
[TD]MDW[/TD]
[TD]1830[/TD]
[TD]175[/TD]
[TD]SW2222[/TD]
[TD]MDW[/TD]
[TD]1830[/TD]
[TD]175[/TD]
[TD]SW2222[/TD]
[TD]MDW[/TD]
[TD]1830[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4321[/TD]
[TD]LGA[/TD]
[TD]400[/TD]
[TD]40[/TD]
[TD]DL4321[/TD]
[TD]LGA[/TD]
[TD]400[/TD]
[TD]40[/TD]
[TD]DL4321[/TD]
[TD]LGA[/TD]
[TD]400[/TD]
[TD]40[/TD]
[TD]DL4321[/TD]
[TD]LGA[/TD]
[TD]400[/TD]
[TD]40[/TD]
[/TR]
[TR]
[TD]DL4566[/TD]
[TD]DTW[/TD]
[TD]300[/TD]
[TD]80[/TD]
[TD]DL4566[/TD]
[TD]DTW[/TD]
[TD]300[/TD]
[TD]75[/TD]
[TD]DL4566[/TD]
[TD]DTW[/TD]
[TD]300[/TD]
[TD]75[/TD]
[TD]DL4566[/TD]
[TD]DTW[/TD]
[TD]300[/TD]
[TD]75[/TD]
[TD]DL4566[/TD]
[TD]DTW[/TD]
[TD]300[/TD]
[TD]75[/TD]
[TD]DL4566[/TD]
[TD]DTW[/TD]
[TD]300[/TD]
[TD]75[/TD]
[/TR]
[TR]
[TD]DL3333[/TD]
[TD]ATL[/TD]
[TD]600[/TD]
[TD]100[/TD]
[TD]DL3333[/TD]
[TD]ATL[/TD]
[TD]600[/TD]
[TD]100[/TD]
[TD]DL3333[/TD]
[TD]ATL[/TD]
[TD]600[/TD]
[TD]100[/TD]
[TD]DL3333[/TD]
[TD]ATL[/TD]
[TD]600[/TD]
[TD]100[/TD]
[TD]DL3333[/TD]
[TD]ATL[/TD]
[TD]600[/TD]
[TD]100[/TD]
[TD]DL3333[/TD]
[TD]ATL[/TD]
[TD]600[/TD]
[TD]100[/TD]
[/TR]
[TR]
[TD]DL2145[/TD]
[TD]LGA[/TD]
[TD]700[/TD]
[TD]68[/TD]
[TD]DL2145[/TD]
[TD]LGA[/TD]
[TD]700[/TD]
[TD]68[/TD]
[TD]DL2145[/TD]
[TD]LGA[/TD]
[TD]700[/TD]
[TD]68[/TD]
[TD]DL2145[/TD]
[TD]LGA[/TD]
[TD]700[/TD]
[TD]68[/TD]
[TD]DL2145[/TD]
[TD]LGA[/TD]
[TD]700[/TD]
[TD]68[/TD]
[TD]DL2145[/TD]
[TD]LGA[/TD]
[TD]700[/TD]
[TD]68[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]UA4567[/TD]
[TD]EWR[/T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TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Totals:[/TD]
[TD][/TD]
[TD][/TD]
[TD]3216[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3211[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3211[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3211[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3211[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]3211[/TD]
[/TR]
</tbody>[/TABLE]
 
You can upload your workbook to a file sharing site like OneDrive or Dropbox or Google Drive and send me the link to access your workbook.

BTW: I have finished the code that puts the space between each group as well. Now I must just get your file sample so I can adapt the macro to run on the structure... :)
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Here is the file: File

Data will start at CellA4. I have posted a mock sheet for 9/2016. Some months obviously vary but weather or not data exists the sort has to start there. Each sheet will be on it's own in one workbook. My "autosort" function only works partially.....it seems my code gives me one or the other but now both. Merged cells and locked cells must stay intact....if possible!!! I know it's asking a lot but I really apprecieate you help!!!
 
Last edited:
Upvote 0
95% there.... Ughhh! Just fussing with an offset issue within the loop. (Taking longer than I expected)
Will upload as soon as possible. Gotta go for supper now!
 
Upvote 0
Hi,

Here is the code that is working.

I must give credit to Hans Vogelaar (at Eileens Lounge) for his valued assistance in resolving this loop issue I had.
His knowledge was instrumental in completing the code!

I have tested it on your workbook and it is running smoothly...

Code:
Sub SortDateBlocks()
    Dim c As Long
    Dim r As Long
    Dim i As Long
    Dim lr As Long
    Application.ScreenUpdating = False
    For r = 3 To 273 Step 54
        For c = 1 To 31 Step 5
            If Cells(r, c).Offset(1).Value <> "" Then
                With Cells(r, c).Resize(51, 4)
                    .Sort Key1:=.Cells(1), Key2:=.Cells(3), Header:=xlYes
                    lr = Application.CountA(.Columns(1))
                    For i = lr To 3 Step -1
                        If Left(.Cells(i - 1, 1).Value, 2) <> Left(.Cells(i, 1).Value, 2) Then
                            .Cells(i, 1).Resize(lr - i + 1, 4).Copy Destination:=.Cells(i + 1, 1)
                            .Cells(i, 1).Resize(1, 4).ClearContents
                            lr = lr + 1
                        End If
                    Next i
                End With
            End If
        Next c
    Next r
    Application.ScreenUpdating = True
    MsgBox "Dates blocks sorted.", vbInformation
End Sub
 
Upvote 0
Hi,

Here is the code that is working.

I must give credit to Hans Vogelaar (at Eileens Lounge) for his valued assistance in resolving this loop issue I had.
His knowledge was instrumental in completing the code!

I have tested it on your workbook and it is running smoothly...

Code:
Sub SortDateBlocks()
    Dim c As Long
    Dim r As Long
    Dim i As Long
    Dim lr As Long
    Application.ScreenUpdating = False
    For r = 3 To 273 Step 54
        For c = 1 To 31 Step 5
            If Cells(r, c).Offset(1).Value <> "" Then
                With Cells(r, c).Resize(51, 4)
                    .Sort Key1:=.Cells(1), Key2:=.Cells(3), Header:=xlYes
                    lr = Application.CountA(.Columns(1))
                    For i = lr To 3 Step -1
                        If Left(.Cells(i - 1, 1).Value, 2) <> Left(.Cells(i, 1).Value, 2) Then
                            .Cells(i, 1).Resize(lr - i + 1, 4).Copy Destination:=.Cells(i + 1, 1)
                            .Cells(i, 1).Resize(1, 4).ClearContents
                            lr = lr + 1
                        End If
                    Next i
                End With
            End If
        Next c
    Next r
    Application.ScreenUpdating = True
    MsgBox "Dates blocks sorted.", vbInformation
End Sub


Almost.....it works EXCEPT the time doesn't get sorted from small to big for each data set within the column.....
 
Upvote 0
Each Airline is unique. If you sort by airline to group them, the time becomes a sub sort to the airline code. If you had duplicate airline codes the time would be sorted from small to big within that duplicate group...but since the airline codes are unique the sub sort cannot kick in. If I had to sort by time as the primary (or first) sort, then the airline codes would not be grouped by their two letters...

Unless I misunderstood your sorting request?
 
Upvote 0
Ok could another script get called to sort the time but maintain the format after the fist sort? It looks perfect exactly what I want. I just need the time to sort as well.... if possible?
 
Upvote 0

Forum statistics

Threads
1,223,999
Messages
6,175,887
Members
452,679
Latest member
darryl47nopra

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