permute columns of Excel document so that first row is ordered alphabetically

I have a big spreadsheet and wanted to do a big transformation. Is there a elegant way to do this?

In a made up example I have columns X,Y, and Z not necessarily in alphabetical order.

enter image description here

I want to turn this spreadsheet into first row alphabetically ordered,

as in

and preserving the distinct columns

How do I do this without click and drag and copying and pasting the columns? This can get messy if I have 42 columns. Is there some kind of automation or script or trick?