Thank you for your response, but that doesn't seem to be working.

If I sort the columns, the categories seem to change. Meaning the same value is not linked to the same category any more.