I’d like to create a macro that will automatically sort a sheet by a column, according to a specified order.
Column A will initially be sorted alphabetically, including strings such as:
BOARD & CARD GAMES
FICTION
HOBBY
LIVING CARD GAMES
I’d like to sort the sheet by Column A in my own arbitrary order, such as
BOARD & CARD GAMES
HOBBY
LIVING CARD GAMES
FICTION
The easiest way I can see to do this is to create a macro that will Find & Replace those strings to add a number at the start, to allow for numerical sorting.
For example, find “BOARD & CARD GAMES”, replace with “1BOARD & CARD GAMES”; find “HOBBY” replace with “2HOBBY”, etc. The Find & Replace operation should only look for entire cells.
The macro should then sort the sheet by column A (numerically), then by column B (alphabetically). I don’t mind if the sorting numbers remain in the final result.
Is there a way to make a single macro command that will Find & Replace any number of terms based on a list of inputs and outputs? Or will I have make a separate command for each term to be replaced? Or is there another way I can sort the sheet in a desired order, without using Find & Replace?
Thanks in advance for any help!