I'm using version 22.214.171.124.. Maybe yours is more recent but the procedure should be the same.
Select your row - should be the first row fro A1 to CV (more or less, if I counted correctly)
Go to menu buttons, find the SORT option. It should be a button with two arrows, (downward/upwrd)
Press the button, you'll open a window with two tabs, the second one is Options
Select tab Options
You have several options; select the last one, Direction
Select left to rignt (sort by rows)
Now press the menu button "ascending" and it will sort the data, the headers in your row in ascending order, from left to right
A tip: Even if "menu buttons" might be different, conceptually Libre Office is HIGHLY compatible with Ms Office so you can follow any MS Office tutorial to get help.