Hello all,

I have a software that runs vba script which creates Excel file with certain data.

I wish this data to be sorted based on two variables. It is way beyond my skills of sorting data before it's being dumped into the sheet, so I am trying to find an easier way.

This script does use Excel template file for certain formatting. Within this file I have set up sort rules but once file is finnished sort is not applied. I can reopen the file, right mouse click->custom sort and the rules are there, as long as I press OK it sorts the data.

Now the question is, is there a code which would replicate earlier described action?

Thanks in advance