- The simplest thing is to use the FILTER function, if your version supports it, on ten different sheets.
- Another macro based solution would be to add a column with a formula like
=G2 & IF(ISNUMBER(FIND("L",UPPER(D2))),"L","H")
and use your splitting macro on that column of formulas.
- An easy alternative to the macro if you don't have the FILTER function is to create 10 power queries, and filter G for each of your 5 possible values, then filter D based on contains H or L - then just refresh the queries when you have a new data set.