Complex VBA Sorting

FrenchCelt

Board Regular
Joined
May 22, 2018
Messages
214
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm trying to find a way to code VBA to sort a report by two categories, simple enough, but the added wrinkle is that there is an extra row that has to be included with the sort, and it throws everything off.

This is a snippet of the original data:

1609625745130.png


I'm trying to sort username alphabetically by shift, so the end result should look like this:

1609625828296.png


The shift order should be 10A, 10B, 12A, and 12B.

If I simply sort by those two categories, of course, this is what happens:

1609625918308.png


The data is put in an order that renders the report useless, so clearly I need to keep the user data together as a unit while sorting, but I'm at a loss to figure out how.

Does anyone have any suggestions?
 
Looks good! Thanks again. I also sorted out the uneven quality of the data by resetting the borders, so it looks clean.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You're welcome, glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,216,074
Messages
6,128,654
Members
449,462
Latest member
Chislobog

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