First of all, thank you for your reply!
But, either I don't understand you or you don't understand my problem 
First of all, I would like a hint towards some sort of VBA solution, since I want it done with the click of a button.
Secondly, when I do what you described, I manage to be able to select all the empty cells, which I then fill with an = sign. Hereafter I can copy and paste special values (which I think I should be able to do anyway), which is not what I am looking for. And I am really not sure what the equal signs are good for. Maybe I'm just being slow here! And sorry for that!
I am looking for a VBA code which can recognize the "groups", which means, the names and amounts which belongs to a specific subgroup. Hereafter I want it to be able to rearrange the groups so the main groups are groued together, ala sorting according to column B.
I know how to programatically recognize the group, making it run through column D or E looking for the blank cells which defines when a group ends and a new one starts. With this I can define the group by range(cells(StartRow, 1), Cells(EndRow, 5))
Something like this:
BUT! How do I save this range and afterwards sort them? Should it be saved to something like an array? and how?
EDIT: Just to be clear, I know that I cant say I = 2 to 22, since it wouldn't consider any new entries, but I have a function which finds the end of the data and uses that to limit the loop.
EDIT 2: with the above-mentioned VBA, no button tho'. test2.xlsm
Bookmarks