Solution Here ‘Input’ refers to main sheet and the values from ‘Input’ is copied to ‘Output’. sorting2 – macro function to sort Shoppee_Run() – A new sheet is created on running macros, copy values from one another, erase the new sheet on every ‘Run’ of macros. Also it creates as a csv file.