Hello, I created a macro and I am having some trouble with a portion of it. During one part, it looks at a column of numbers and adds a fill color to the cell based on the value. It'll be red if it's 0 or #N/A, orange if it's greater than 0 but less than or equal to 7, yellow if it's greater than 7 but less than or equal to 14, and then left white if it's greater than 14. I then want to sort this data. I recorded a macro to sort it by color in ascending order going red, orange, yellow, and then white (see code below). Normally, I would just sort by low to high value but I need the #N/A to be at the top with the 0's so that's why I decided to sort by color instead. But the problem is that the sorting within the color categories is not numerical. I can manually go in and sort by the value from low to high and then by color, but I want the macro to do it and I can't seem to get the code to work to do that. Would anyone be able to modify the code below so it sorts by the value and then sorts by the color? Thank you! Since this is recorded code it is messy, so also feel free to tell me what I could do to simplify it, as well.
Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
Bookmarks