VBA - Format Rows containing word 'Total'

tlc53

Active Member
Joined
Jul 26, 2018
Messages
365
The reason that you cannot see which data should be sorted is because you didn't place the code where I suggested ..
Sorry! :rolleyes: I missed reading that bit.

So now I can see it is applying the sort. Only one small error is occurring. There is one category called "Free of Charge" which it is putting at the bottom, where in this case, it needs to go at the top. It has zero values associated with it but has 6x transaction lines.

So (in this example) the order it needs to be in as per K21:K35 is;

36164 (Free of Charge)
36165
36167
36168
36169
36170
36162

And the order it is putting it in is;

36165
36167
36168
36169
36170
36162
36164 (Free of Charge)

Is there perhaps a second sort in action that is causing this?

Thank you.
 

Some videos you may like

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,443
Office Version
365
Platform
Windows
Any chance of another sample file with this in it so I can see what is happening and test any possible solution?
 

tlc53

Active Member
Joined
Jul 26, 2018
Messages
365
Any chance of another sample file with this in it so I can see what is happening and test any possible solution?
I had a think about it and the solution was quite simple. I just ran the range from K20:K35 instead of K21:K35. That way it included the header.

Works an absolute charm. Couldn't have done it without you. Thank you for your help and your patience :)
 

Peter_SSs

MrExcel MVP, Moderator
Joined
May 28, 2005
Messages
44,443
Office Version
365
Platform
Windows
Can't quite see how that made a difference but it doesn't matter. If it works, that's great. Thanks for letting us know. :)
 

Watch MrExcel Video

Forum statistics

Threads
1,095,816
Messages
5,446,664
Members
405,413
Latest member
AlainCar

This Week's Hot Topics

Top